Ping DHCP mystery

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mhwelsh

Ping DHCP mystery

Post by mhwelsh »

I have two computers one named 'windows' and the other named 'linux'.
These are both fed by a 'Belkin 54G' wireless router which is also fed with the output of a 'Voyager 205' ADSL modem/router which enables connection to the internet. The internal pci cards, Belkin wireless G desktop cards were enabled automatically by clicking on the signal strength symbol, four little blue bars, producing 'Auto belkin54g' connections using DHCP. The DHCP controller is in the Belkin 54G router.
Connection to the internet is faultless.
Samba is installed on both computers. /etc/samba/smb.conf is the sample file given with the installation but the workgroup has been set to 'glassellodge' and several folders have been added. The smb.conf used is the foreshortened version derived from testparm -s.

If I ping from one computer to the other "ping: unknown host linux/windows" appears on the terminal.
If I ping the ip address of the distant computer;
"martin@windows ~ $ ping 192.168.2.2
PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.
From 192.168.2.3 icmp_seq=1 Destination Host Unreachable
From 192.168.2.3 icmp_seq=2 Destination Host Unreachable
^C
--- 192.168.2.2 ping statistics ---
16 packets transmitted, 0 received, +12 errors, 100% packet loss, time 15068ms
, pipe 3"

If I ping the Belkin 54G wireless router;

"martin@windows ~ $ ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=2.16 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=1.72 ms
64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=1.51 ms
64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=1.66 ms
^C
--- 192.168.2.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.517/1.767/2.160/0.242 ms"
No mention of pipe 3!

If I ping the ADSL router, the gateway;

"martin@windows ~ $ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=18.4 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.64 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=2.76 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=2.83 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 2.646/6.683/18.491/6.817 ms"

I tried adding the names and the IP addresses to /etc/hosts. Whilst they worked on the day that I added them they did not work on the following day even though the IP address of wlan0 had not changed.
With the /etc/hosts file altered initially samba worked well but failed miserably on the second day as did the ping tests.

I am a not very expert NEWBIE. It seems as though DHCP is not working properly. I have the choice of putting DHCP control into either computer or the ADSL router or leaving it in the Belkin router - which is the best place? The Belkin Wireless Router has a section entitled DHCP client list where it boldly proclaims;
"windows 192.168.2.3 00:11:50:de:2b:ec
linux 192.168.2.2 00:11:50:de:2d:9d"
Why does it not tell the computers this?

More to the point how do I fix it?

martin welsh
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Ping DHCP mystery

Post by remoulder »

Martin, sorry no one has replied earlier. Are you sure the 2 machines are receiving the same IP at each boot, have you fixed the IP to the MAC in the DHCP server? For 2 machines it would probably make more sense to use fixed IP addresses rather than DHCP. Did you edit the hosts as root, otherwise the changes will not have been saved?
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
mhwelsh

Re: Ping DHCP mystery

Post by mhwelsh »

The ip addresses allocated by the Belkin router have remained consistent. Windows 192.168.2.3 and linux 192.168.2.2.
I do not really understand; "have you fixed the IP to the MAC in the DHCP server?" but I think that the answer is no I have merely 'checked' the DHCP on button. The editing of the hosts file has never changed despite many ons and offs.
Since sending this post it has dawned on me that the problem may lie with the DNS system that is not telling everybody where everybody else is.
At the moment I am frantically trying to recover the MBR on the linux machine so it is all presently on hold.

Given the layout of my equipment : ADSL router/modem - Belkin Radio Router - Two computers - where are the optimum places for locating the DHCP master and the DNS server?
My isp has allocated me a fixed ip address, he has also offered two DNS server ip addresses.
I have assumed that my DNS address is the same as the gateway address, 192.168.1.1, the ADSL router. Is this the right thing to do? What is the best place for the DHCP server, the ADSL router, the Belkin router or one of the machines?
Is it prudent or desireable to put the addresses of the isp's DNS server into /etc/resolv.conf?

Operating systems used to give the installer/user the responsibility of selecting DHCP or Static but now auto connect puts you on to DHCP and you have to 'interfere' with the installation process to install static addresses. It would be nice to know how to get the best out of the Auto Connect.

Many thanks for answering and please do not look upon my monster continuation as punishment!

Regards,


martin welsh
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Ping DHCP mystery

Post by remoulder »

mhwelsh wrote:I do not really understand; "have you fixed the IP to the MAC in the DHCP server?
In most DHCP servers there should be an option to pre-assign or fix an IP to a particular MAC (hardware) address to prevent it changing.
mhwelsh wrote:The editing of the hosts file has never changed
You might want to post this here if you can't get it to work.
mhwelsh wrote:where are the optimum places for locating the DHCP master and the DNS server
The DHCP server is or should be built into the router, you do not need a DNS server as this is provided by your ISP.
mhwelsh wrote:I have assumed that my DNS address is the same as the gateway address, 192.168.1.1
mhwelsh wrote:Is it prudent or desireable to put the addresses of the isp's DNS server into /etc/resolv.conf?
No in both cases. Unless you want to specify specific DNS addresses you do not need to specify any as they are provided by DHCP assuming your router picks up your ISPs. If you do want to use specific DNS servers you put the addresses either in your router or in the network manager connection, anything you put in resolv.conf will be overwritten by NM.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
mhwelsh

Re: Ping DHCP mystery

Post by mhwelsh »

mhwelsh wrote:where are the optimum places for locating the DHCP master and the DNS server

Your reply -
The DHCP server is or should be built into the router, you do not need a DNS server as this is provided by your ISP.

If this is the case why does the belkin router, the DHCP master, correctly display the names and ip addresses but they are not sent back to the computers that are named. Why should I expect to get the names of computers within my LAN from my IPsupplier? I think that I am wrong perhaps in my assumptions.

You will have noted from my original post that there appear to be irregularities in the behaviour of the ping command.
The ping command does not recognise the distant host name - fair enough we will put that down to DHCP and DNS hiccups.
The ping command to the distant computer loses a lot of the pings and yet the ping command to either the belkin router, the ADSL router or the ip address of the instigating computer works like clockwork.

"martin@linux ~ $ ping 192.168.2.3
PING 192.168.2.3 (192.168.2.3) 56(84) bytes of data.
64 bytes from 192.168.2.3: icmp_seq=1 ttl=64 time=1018 ms
64 bytes from 192.168.2.3: icmp_seq=2 ttl=64 time=18.9 ms

--- 192.168.2.3 ping statistics ---
10 packets transmitted, 6 received, 40% packet loss, time 9033ms
rtt min/avg/max/mdev = 1.728/188.560/1018.506/372.437 ms, pipe 2"
Here 'linux' 192.168.2.2 is pinging 'windows' 192.168.2.3.
Surely pinging ip addresses is no different to having static ip addresses.
What is the significance of "pipe 2"?

I will go away and set them up as static ips' and let you know what happens.

martin
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Ping DHCP mystery

Post by remoulder »

mhwelsh wrote:Why should I expect to get the names of computers within my LAN from my IPsupplier?
Martin, your isp's DNS won't supply the IPs of your local lan machines, that's what you're using the hosts file for, but you need your isp's DNS to supply internet addresses. The DHCP won't supply the names, it simply allocates an address to a machine but the as machine identifies itself when making the request the server will know it's name.

See http://compnetworking.about.com/od/home ... iagram.htm for a basic network diagram. I think you may have some option in your router to allow local machines to see each other. I do not know the model so can't help here. Also check your hosts file is correct.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
mhwelsh

Re: Ping DHCP mystery

Post by mhwelsh »

Sorry I have not replied sooner.

Since last writing the router had a freakout and as you are probably aware getting them to work again is not an easy task.

The reason for the freakout was me having the temerity to change some settings. The change that appeared to cause the hysterics was changing DNS settings from Auto to the addresses of the DNS server that my isp gave me. Eventually it healed up.

I have had one try at installing fixed IP working but this caused hysterics in the ADSL modem. Another try soon.

A few years ago I would have expected to type in every setting to the appropriate file to get the system working but with more modern systems it should be more automatic even for fixed ip addresses.

Going back to your patient responses;

What has thrown me is that there have been no changes to the wording in etc/hosts or etc/resolve.conf by the machine and I think that this also applies to fixed ip settings. Because nobody has told the machines what the other is called we must assume that the router, a Belkin54g, which has a record of which name has which number, should translate names to numbers when it hears the broadcast call. Well it dosen't.

None of this explains the odd ping behaviour.
Here we are working with ip numbers only.
Ping to local machine(using its ip number), ping to the router and ping to the ADSL modem/router every one a winner.
Ping to the ip number of the other machine and less than half of the pings get through if you are lucky.
You may say ah yes they are getting stuck in the router, but why do they reach the ADSL modem/router where they have to go into and out of the router to get there.

Now I shall go away and swot your recommended article to make sure that what I am doing is correct.


martin welsh
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Ping DHCP mystery

Post by remoulder »

mhwelsh wrote:we must assume that the router, a Belkin54g, which has a record of which name has which number, should translate names to numbers when it hears the broadcast call. Well it dosen't
This would be correct, it is not the function of a router to do this, a router is in brief a device that 'routes' data between an input port to an output port. On a large network you would have a dedicated DNS server to provide this information bu on a small home network it is usually done using the hosts and lmhosts files.
mhwelsh wrote:You may say ah yes they are getting stuck in the router, but why do they reach the ADSL modem/router where they have to go into and out of the router to get there
Are you sure you have the cables in the correct ports on the router? The ADSL modem should be connected to the WAN port and your computers to any of the others, though if the router also has a specific port for a DMZ you should avoid using that.

I still think you need to check and understand the settings of your router and I cannot really help you with this. Good luck.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
mhwelsh

Re: Ping DHCP mystery

Post by mhwelsh »

With the two machines set to DHCP the system makes no entries into the hosts file and in MintLinux the lmhosts file is not used. (Supposed to be /etc/samba/lmhosts)
From this I conclude that if the router does not convert ip names to ip numbers nothing else does therefore the system will have the symptoms which I originally described. Should I report this as a bug?

I tried setting each machine to 'manual' which I have assumed means allocated ip address number.
I entered the allocated addresses/numbers into both hosts files and reset the router to DHCP off.
With these settings connection to the internet is disabled. The router says that it is connected to the internet and the ADSL modem passes all of its tests except internet connection. The settings used for the ip addresses were;
i/p 192.168.2.5(6) Netmask 255.255.255.0 Gateway 192.168.1.1.

Both experiments were carried out using both a wired connection, eth0, and wireless, wln0.

I have reverted to restricting the choice of DHCP numbers to 2 and put entries into the /etc/hosts file as appropriate.

I will appreciate your comments about whether there may be a bug in the system software.
The connections to the router, the modem and the machines comply with the recommendations in the equipment hand books, the pci radio cards are manufactured by Belkin as is the router and connection wise I have used 'autoconnect' wherever possible.

Thanks for your help.


martin welsh
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Ping DHCP mystery

Post by remoulder »

mhwelsh wrote:the system makes no entries into the hosts file
You must do this manually.
mhwelsh wrote:I conclude that if the router does not convert ip names to ip numbers nothing else does therefore the system will have the symptoms which I originally described. Should I report this as a bug?
Martin as I have already tried and apparently failed to explain, DNS resolution is not a function of the router. For your local network you have to have a local DNS server or use the hosts file. For the internet you have to specify the IP address of an internet DNS server in your connection. Your router 'may' pass your ISP's DNS addresses to your local machines via DHCP or you can specify them manually. There is no bug here.
mhwelsh wrote:The settings used for the ip addresses were; i/p 192.168.2.5(6) Netmask 255.255.255.0 Gateway 192.168.1.1
mhwelsh wrote:With these settings connection to the internet is disabled
If 192.68.1.1 is the IP of the router then these settings should be fine, you will not get internet access however since you have not specified any DNS addresses unless these are specified in the router.

As I said I think you need to read up on this and attempt to understand it some more as it is a complex subject.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
mhwelsh

Re: Ping DHCP mystery

Post by mhwelsh »

I am making the apparently false assumption that if I select auto connect for a wlan connection instigating that action will initiate a complete operation - no need for any file editing. That is the 'bug' that I am referring to.

If you institute DHCP operation there is no guarantee that the DHCP master will allocate the same address every time. What wording should be used in the /etc/hosts file to cover all possibilities?

DNS refers to the translation of Domain Names to ip numbers. When does a host name become a domain name?

192.168.2.1 is the belkin router, the only DHCP master. 192.168.1.1 is the ADSL modem, also, confusingly called a router.
The ADSL modem passes on requests for DNS service to the isp who run a DNS service. Hence the use of 192.168.1.1 as the gateway. Why disabling of the DHCP function should inhibit connection to the ADSL modem(the internet) is a mystery which is not helped by the interface with the belkin router proudly proclaiming that it is connected!
When I say inhibit connection I mean that the browser could not connect to it.

I will persist with my voyage of discovery. You may have noticed that I am strong in stubborness - and dyslexia.

Again many thanks for your help and patience.


martin welsh
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Ping DHCP mystery

Post by remoulder »

I think you need to read up a bit more on how networks are configured. Wikipedia might be a good place to start http://en.wikipedia.org/wiki/Computer_network. If your modem is also a router you should probably only use it as a modem and use the Belkin for feeding the network and for DHCP.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
mhwelsh

Re: Ping DHCP mystery

Post by mhwelsh »

I have been away and read about DHCP, I can understand that. The important bit seems to be that to comply only the ip address needs to be sent back.
The routers I have found harder to digest as there are too many if and when loops.

Since last communicating I have tried another router and made sure that the software in the Belkin router was up to date. I replaced it and it made no difference to the performance.
The second router is an Edimax and contains the ADSL modem in the same box. Comparing the two handbooks the Edimax talks about its routing functions and mentions its routing tables, Belkin merely says that it has DNS.
The results are more interesting. With the ip addresses in /etc/hosts everything suddenly does what I expected.

martin@windows ~ $ ping linux
PING linux (192.168.2.2) 56(84) bytes of data.
64 bytes from linux (192.168.2.2): icmp_seq=1 ttl=64 time=1.16 ms
64 bytes from linux (192.168.2.2): icmp_seq=2 ttl=64 time=2.05 ms
64 bytes from linux (192.168.2.2): icmp_seq=3 ttl=64 time=2.04 ms
64 bytes from linux (192.168.2.2): icmp_seq=4 ttl=64 time=1.11 ms
64 bytes from linux (192.168.2.2): icmp_seq=5 ttl=64 time=1.39 ms
64 bytes from linux (192.168.2.2): icmp_seq=6 ttl=64 time=0.951 ms
^C
--- linux ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 0.951/1.454/2.059/0.445 ms

martin@windows ~ $ ping 192.168.2.3
PING 192.168.2.3 (192.168.2.3) 56(84) bytes of data.
64 bytes from 192.168.2.3: icmp_seq=1 ttl=64 time=0.060 ms
64 bytes from 192.168.2.3: icmp_seq=2 ttl=64 time=0.046 ms
64 bytes from 192.168.2.3: icmp_seq=3 ttl=64 time=0.043 ms
64 bytes from 192.168.2.3: icmp_seq=4 ttl=64 time=0.051 ms
64 bytes from 192.168.2.3: icmp_seq=5 ttl=64 time=0.047 ms
^C
--- 192.168.2.3 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3997ms
rtt min/avg/max/mdev = 0.043/0.049/0.060/0.008 ms

Thank you for your help.
I have put in a suggestion that LinuxMint incorporates software that keeps the /etc/hosts file in step with the DHCP numbers allocated.

http://forums.linuxmint.com/viewtopic.php?f=29&t=45070


martin welsh
Locked

Return to “Networking”