Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm putting my hands on a legacy system (a Xen cluster) and I'm trying to understand its architecture. It seems that there are services listening on an IP (say, 1.2.3.4) that doesn't show up in ifconfig output:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:3e:98:46:4b  
          inet addr:3.3.3.3  Bcast:3.3.3.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe98:464b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2701271309 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2580523122 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2013971483375 (1.8 TiB)  TX bytes:1994970579127 (1.8 TiB)

eth0:0    Link encap:Ethernet  HWaddr 00:16:3e:98:46:4b  
          inet addr:10.0.5.4  Bcast:10.0.5.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:12776938 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12776938 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2103144670 (1.9 GiB)  TX bytes:2103144670 (1.9 GiB)

If I have nc listen on the IP 1.2.3.4, it is reachable by the outside:

nc -s 1.2.3.4 -p 8081 -l

(i.e. I can telnet or nc to 1.2.3.4:8081 and send data).

This leads me to the conclusion that there's no NAT. However, why doesn't ifconfig list the IP?

share|improve this question
    
From where can you telnet to 1.2.3.4:8081? From on the system itself, or from another system? –  MadHatter Apr 8 '11 at 8:55
    
if you want to identify what is listening you can use the -p option of netstat, e.g. netstat -lp –  Jason Tan Apr 8 '11 at 9:15
    
@MadHatter, I tried connecting from both the same system and another one. – @Jason Tan, that's where I discovered that I had a daemon listening on that address. I was actually asking why ifconfig doesn't list it. –  Alessandro Apr 8 '11 at 19:24

2 Answers 2

up vote 2 down vote accepted

I've seen cases where ifconfig doesn't show all of the addresses assigned to an interface, but they can be seen with ip addr (where ip is from the iproute2 package).

share|improve this answer
1  
You're right. ip addr lists that address under eth0, as well as other ones. This confirmed that the system is actually bound to that address. With further investigation I discovered that there is a keepalived daemon managing the assignment of the address. You didn't answer to my question (why ifconfig doesn't list all IPs), however your answer helped me a little by confirming that my assumption was right. –  Alessandro Apr 8 '11 at 19:26
     -s hostname/ip-address
             Specifies the IP of the interface which is used to send the pack-
             ets.  On some platforms, this can be used for UDP spoofing by
             using ifconfig(8) to bring up a dummy interface with the desired
             source IP address.
$ nc -s 1.2.3.4 -p 8081 -l &
Can't grab 1.2.3.4:8081 with bind : Cannot assign requested address

Perhaps if you run ifconfig from another terminal session whilst nc is still running, you might see what is happening.

share|improve this answer
    
Thank you! I tried what you suggested but ifconfig still doesn't show that IP. –  Alessandro Apr 8 '11 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.