Click to See Complete Forum and Search --> : Static ip with a linksys router


reiign
05-18-2004, 02:37 PM
I wanna setup a static ip and i am stuck trying to figure out what to put in for network and gateway. (in /etc/network/interfaces) this is under debian sarge.

heres my ipconfig from win2k


Windows 2000 IP Configuration

Host Name . . . . . . . . . . . . : sata
Primary DNS Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Broadcast
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VIA Rhine II Fast Ethernet Adapter
Physical Address. . . . . . . . . : 00-0C-76-BE-91-B6
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.1.102
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 68.6.16.25
68.6.16.30
68.2.16.30
Lease Obtained. . . . . . . . . . : Tuesday, May 18, 2004 6:09:45 AM
Lease Expires . . . . . . . . . . : Wednesday, May 19, 2004 6:09:45 AM

The thing is i wanna DMZ my machine and i dont want the router giving me a different ip every day when i have it set to 102 as the machine to be DMZ'd.

JayMan8081
05-18-2004, 02:55 PM
You can probably just set your router to give the machine the same IP. On my d-link router I simply enter the MAC address of the network card and the IP that I want to be assigned to it. I can still leave DHCP enabled on the router so that other machines can automatically obtain IPs. I would look into your documentation for your router and see if this is possible. I would think that you could.

sporkit
05-18-2004, 03:18 PM
you should put the address of your router as your gateway. in my experiance you should use that address as your dsn too. ive had problems setting them to my actual dns.

reiign
05-18-2004, 03:25 PM
Originally posted by JayMan8081
You can probably just set your router to give the machine the same IP. On my d-link router I simply enter the MAC address of the network card and the IP that I want to be assigned to it. I can still leave DHCP enabled on the router so that other machines can automatically obtain IPs. I would look into your documentation for your router and see if this is possible. I would think that you could.

not with this linksys router.
in fact, u cant do that with any linksys router.

well what i did in win2k is put the ip info in myself and that works but in linux i just need to know those two things.

can i go without them in the /etc/network/interfaces file?

j79zlr
05-18-2004, 03:28 PM
Run netconfig as root and enter the info. I think that works for all distros, the config file is different, in slackware the IP info is in /etc/rc.d/inet1.conf

DMR
05-18-2004, 03:39 PM
Originally posted by reiign
well what i did in win2k is put the ip info in myself and that works but in linux i just need to know those two things.

can i go without them in the /etc/network/interfaces file?

You'll definitely need a gateway entry, which will be the IP of the router. The network IP might be inferred from your machine's IP, but if not it would be 192.168.1.0 for your setup.

IsaacKuo
05-18-2004, 04:30 PM
Actually, it would be 192.168.1.1

You do not need to deactivate DHCP on the router. It looks like your router is set to be a DHCP server with IP range from 192.168.1.100 to 192.168.1.255 (probably). That's fine. It sounds like your router is set up just like mine, then. The router will work with any machines with IP address between 192.168.1.2 and 192.168.1.255, even with DHCP turned off. Just think of the addresses below 192.168.1.100 as static IP addresses.

Thus, you want to turn off DHCP on your computer; you can leave DHCP turned on on all of the other computers. Manually assign your computer a static IP address between 192.168.1.2 and 192.168.1.100. You'll also need to set default Gateway and DNS to 192.168.1.1 (it's okay to have other entries in DNS search--but 192.168.1.1 is the only one you really need).

Do NOT assign your machine a static IP between 192.168.1.100 and 192.168.1.255. If you do so, then it will probably work--for now--but you run the risk of the router assigning that IP address to some other computer via DHCP. That would not be good.

DMR
05-18-2004, 05:24 PM
Originally posted by IsaacKuo
Actually, it would be 192.168.1.1 No, that is the router's IP. With a 255.255.255.0 netmask, the network address (not the address of any node on that network) for that IP range is 192.168.1.0.

IsaacKuo
05-18-2004, 05:26 PM
Sorry, I read too fast and didn't read it right. Yeah, you're right.

DSwain
05-18-2004, 05:41 PM
that's odd, because i have a linksys router myself, and the DHCP server never changes any of my IP addresses (unless of a sudden power outage for a period of time for some reason)

anyways, looking at my router, if you're in the config, it should tell you what Gateways and things to use. Looking at the config some more, you may want to disable DHCP, or maybe set the amount of DHCP users to 0 and see if you can set them like that.