LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-15-2012, 10:01 AM   #1
simpzoid
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Static DCHP problems


Dear All,

I have 2 linux boxes on the same network.

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:

i.e.
11:12:13:14:01
instead of
11:12:13:14:00

Any thoughts?
 
Old 06-15-2012, 12:17 PM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,209

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
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.
 
Old 06-15-2012, 02:46 PM   #3
simpzoid
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
This is what netsat gives me with the static config

scott@www:/etc/network$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 192.168.1.254 0.0.0.0 UG 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0

and with the working DCHP
scott@www:/etc/network$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default O2WirelessBox.l 0.0.0.0 UG 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0

The only difference I see is that the working config knows the gateway's A name, 192.168.1.254 = O2WirelessBox.

I could do with some further help.
 
Old 06-15-2012, 03:43 PM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,209

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Could you post the results of '/sbin/ifconfig eth0' for both scenarios? Could you post the error message(s) you get when it is failing.
 
Old 06-15-2012, 04:07 PM   #5
simpzoid
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
this is the working dchp ifconfig

scott@www:/etc/network$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:21:9b:fa:4f:00
inet addr:192.168.1.74 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::221:9bff:fefa:4f00/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8136 errors:0 dropped:0 overruns:0 frame:0
TX packets:5606 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8556095 (8.5 MB) TX bytes:729836 (729.8 KB)
Interrupt:16

this is static and doesn't work

eth0 Link encap:Ethernet HWaddr 00:21:9b:fa:4f:00
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::221:9bff:fefa:4f00/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1273 (1.2 KB) TX bytes:6973 (6.9 KB)
Interrupt:16

e.g.

^Cscott@www:/etc/network$ ping 192.168.1.254
PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.
From 192.168.1.102 icmp_seq=1 Destination Host Unreachable
 
Old 06-15-2012, 04:25 PM   #6
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,209

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
I don't see any problems with any of your settings.

What happens if you change the machine that is 101 to 102, and the 102 to 101? Just wondering if this is router config problem.
 
Old 06-16-2012, 07:44 AM   #7
simpzoid
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-16-2012, 08:13 AM   #8
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,209

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Do you have a file /etc/hosts on either, or both machines? If yes, would you post the contents?

Do you know how to connect to the router, and look at the configuration? If not, post the make and model number. There is probably doc online.
 
Old 06-16-2012, 10:01 AM   #9
simpzoid
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
The hosts file looks like this (both machines are the same except the second line).

127.0.0.1 localhost
127.0.1.1 www

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I normally connect to the router through a web browser by pointing it at 192.168.1.254, which works, except on 192.168.1.102.

The router is a Thomson Gateway TG585, not sure of the version I think it is V7
 
Old 06-16-2012, 10:08 AM   #10
simpzoid
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-16-2012, 10:20 AM   #11
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,209

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
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.

Last edited by camorri; 06-16-2012 at 10:22 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
debian ibm/acpi/dchp/volume problems kosh79 Linux - Newbie 5 11-23-2005 07:40 PM
Problems with static ip ZeRo69er Linux - Networking 2 12-07-2004 01:52 PM
Dchp? tamtam Linux - Networking 30 12-01-2004 06:52 AM
DCHP Client Problems with kernel upgrade coolie Linux - Networking 0 04-17-2004 03:42 PM
Dchp linux_monkey Linux - Networking 3 01-04-2004 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration