LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-16-2013, 09:28 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Who is ping talking to?


Hi:

I have a LAN consisting of two hosts. Lets call one the server (or remote host) and the other the local host. Both are connected to internet through a router and modem. Running ifconfig in the server I get:
Code:
root@SERVER_HOST:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.101  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::922b:34ff:feb8:78cf  prefixlen 64  scopeid 0x20<link>
        ether 90:2b:34:b8:78:cf  txqueuelen 1000  (Ethernet)
        RX packets 114069  bytes 66498298 (63.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 245027  bytes 40631115 (38.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 42  base 0x4000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 740  bytes 43884 (42.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 740  bytes 43884 (42.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
If, in the local host I do 'ping 192.168.0.101', I get:
Code:
................................................
64 bytes from 192.168.0.101: icmp_seq=1 ttl=64 time=1.77 ms
.................................................
That is, the local host is talking to someone. The question is: whom is it talking?

Last edited by stf92; 02-16-2013 at 09:45 PM.
 
Old 02-16-2013, 10:25 PM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Itself
 
Old 02-16-2013, 10:27 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Why's that?
 
Old 02-16-2013, 10:28 PM   #4
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Because you told it to.

Do you think this is some sort of error?
 
Old 02-16-2013, 10:34 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
In the first code block, you see it says: 'inet 192.168.0.101'. And as I ran ifconfig in the server, it is some IP associated with the server, not with the local host. So when I do ping 192.168.0.101 from the local host, how can I be talking to the the local host? No, I do not say it's an error. I want to know what is 192.168.0.101.
 
Old 02-16-2013, 10:43 PM   #6
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Now I'm getting confused.

Try "arp -n" to see what IP addresses are local to a machine, anything that is routed via a router will not appear in this list.
 
Old 02-16-2013, 10:47 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
I get
Code:
root@SERVER_HOST:~# arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.105                    (incomplete)                              eth0
192.168.0.1              ether   a0:f3:c1:59:06:2a   C                     eth0
root@SERVER_HOST:~#
 
Old 02-16-2013, 10:48 PM   #8
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
You ran `ifconfig` on the "server", and it says that the server is 192.168.0.101.
Then you ran `ping 192.168.0.101` from the "local host".
So given that both "server" and "local host" are on the same network (192.168.0.0/24), ping is talking to "server", who is 192.168.0.101.
 
Old 02-16-2013, 10:54 PM   #9
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
But in /etc/hosts (in the server) I have:
Code:
# For loopbacking.
127.0.0.1		localhost
127.0.0.1		SERVER_HOST.DN1 SERVER_HOST

# End of hosts.
And I do not see 192.168.0.101 in it. Besides, I, the server, am SERVER_HOST.DN1. So why is it not associated to 192.168.0.101 in /etc/hosts?
 
Old 02-16-2013, 11:04 PM   #10
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Well your hosts file is broken as it should have the real IP not the loopback one.

Also I smell a VPN here, am I right on that?
 
Old 02-16-2013, 11:05 PM   #11
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
/etc/hosts contains whatever you put in it (the defaults that comes with the etc-package only lists 127.0.0.1). Just about all computers see themselves as 127.0.0.1, it's the loopback interface (as you can see in the lo: section of the ifconfig output: "inet 127.0.0.1 netmask 255.0.0.0").
SERVER_HOST sees itself as 127.0.0.1, as does your other computer. It's eth0 with ip 192.168.0.101 on SERVER_HOST that your other computer can connect to SERVER_HOST through.
 
Old 02-16-2013, 11:08 PM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
I wanted to set the hostname and the domainname and could not do it. So I used netconfig and gave it those names. What it did I do not know, but after I ran it, /etc/hosts was as you see it. About VPN, honestly I don't know what it is.
 
Old 02-16-2013, 11:20 PM   #13
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
If you used netconfig to configure for the static ip 192.168.0.101 then /etc/hosts should contain a corresponding line. The setting you have seems to be what you get when setting up the network for dhcp with netconfig.
 
Old 02-16-2013, 11:22 PM   #14
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by e5150 View Post
/etc/hosts contains whatever you put in it (the defaults that comes with the etc-package only lists 127.0.0.1). Just about all computers see themselves as 127.0.0.1, it's the loopback interface (as you can see in the lo: section of the ifconfig output: "inet 127.0.0.1 netmask 255.0.0.0").
SERVER_HOST sees itself as 127.0.0.1, as does your other computer. It's eth0 with ip 192.168.0.101 on SERVER_HOST that your other computer can connect to SERVER_HOST through.
But who should SERVER_HOST.DN1 be for the local host. If I do rcp SERVER_HOST.DN1:some_file some_directory, on the local host (LOCAL_HOST.DN2), rcp must address some IP. What IP is that?
 
Old 02-16-2013, 11:29 PM   #15
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
Quote:
Originally Posted by stf92 View Post
but who should server_host.dn1 be for the local host. If i do rcp server_host.dn1:some_file some_directory, on the local host (local_host.dn2), rcp must address some ip. What ip is that?
192.168.0.101
 
  


Reply



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
Cannot connect to LANs - ifconfig and iwconfig show no devices spiderjim Linux - Networking 7 11-21-2009 03:10 AM
Script for IFCONFIG tht PING with destination ip address in same format pooppp Linux - Networking 1 07-31-2008 10:19 AM
slack 10.2 install ..missing things like ping,ifconfig techentral Slackware 8 01-15-2006 10:58 AM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
using ping and ifconfig in C program Menestrel Programming 2 12-20-2004 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:41 PM.

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