Using static ips with a router
I'm having trouble setting my Debian box to use a static ip. My dad has a US Robotics wireless router with DHCP enabled for the ip range 192.168.xxx.100-199. Now we have 2 wireless connections and about 4-5 ethernet connections that are set up to use DHCP (including my Debian box). Apart from my machine, all the other computers use Windows.
Now when I tried to set /etc/network/interfaces to use a static ip for eth0, ifconfig reports the correct ip, but I can't get internet access (although I can ping the router using the gateway ip). Here is /etc/network/interfaces: ... # The primary network interface auto eth0 iface eth0 inet dhcp #iface eth0 inet static # address 192.168.xxx.104 # netmask 255.255.255.0 As I said, if I comment out the dhcp line, and uncomment the static lines, and then run 'ifdown eth0' and 'ifup eth0' or restart, ifconfig reports the correct ip and subnet, but I can't ping anything outside the lan or access any websites. What should I do? I want to forward some ports to my comp, and it's easier to do if my comp has a static ip. Thanks for any help. God bless Hiran |
Have you updated the routing table to set the default route to go through the wireless router? If you run the command 'route' it will show you the current routing table - the default route needs to be the gateway. E.g. my box is configured like this:
Code:
[david@malvern ~]$ route Firstly, if you already have a default route in the routing table, run this: Code:
route del default Code:
route add default gw 192.168.0.1 |
Yes the above post looks like the right diagnosis. In Debian you just need the line
gateway 192.168.1.254 in that /etc/network/interfaces files (change the address to suit your router). As well as the iface, address and netmask lines, of course. |
All times are GMT -5. The time now is 10:08 AM. |