Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
They first host has the following /etc/network/interface file:
auto eth0
iface eth0 inet static
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.254
auto lo
iface lo inet loopback
The second is identical but the address is:
192.168.1.102
The first host works fine. The second host can see machines on the network (e.g. 192.168.1.101) but cannot see the gateway (ping 192.168.1.254 gives destination host unreachable).
If I change the second host to DCHP. The second host works fine.
The only other clue I can see is that using a static ip the mac address for the 2nd host is wrong when I log into the router, i.e. the last digit in the mac address is 1 higher than it should be:
Have you got a default route set on the failing machine? Run the command 'netstat -r' without the quotes, and see if one is set. It will look something like this:
Quote:
netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default cisco 0.0.0.0 UG 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
localnet * 255.255.255.0 U 0 0 0 eth0
I have /etc/hosts file updated with a name of cisco, you will see an IP address in that field unless you update the hosts file.
Well, swapping 102 and 101 allows the now working box to connect but the box which was working no longer works, i.e. 192.168.1.101 allways works regardless of the box but 102 never works. I take it this means that the problem is indeed with the router. I appreciate the help i've been given so far but I am afraid I need more help as this is all getting a bit beyond me.
Mmmm. I have changed the non working host to 192.168.1.201 and it works. 192.168.1.101 also works so it looks like a router issue. The router is a cheapo thing provided by my ISP and may not be up to the task.
I am not wedded to having my servers as 101 and 102 so I think I'll just give them new numbers and move on.
Thanks for all the help, which was really prompt, to the point and, er, helpful.
There doesn't appear to be anything I see wrong in /etc/hosts. So, It would appear to be related to your router.
I'm not familiar with our router. My comments will have to remain general.
Most routers you can set the range of addresses the DHCP server will give out, the ones I have had are in groups of four. Most routers are set for class C networks ( like yours ) to allow all addresses ( 254 ) to DHCP. Depending on the number of devices you have that rely on DHCP, set a value that leaves some addresses of the 254 not in the DHCP range. These ones you can use for static addresses.
The routers I have had, this doesn't seem to matter. I have set static addresses within this range, and all was well. The problem you can have, is if the router has given out the IP you want to use for a static address, and you turn that device on, it won't get in.
Beyond that, there is some security ( small ) risk with having a DHCP range much greater than the number of devices you might want using DHCP. Is this a wireless router? My guess is yes, most home routers are WAP's.
You might want to look to see if there is any code updates for the router. This is a bit of a long shot, however, this problem doesn't seem to make sense.
Looks like we were both typing at the same time. Glad you found a work around.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.