-3

I am not sure why the command "ifconfig" did not show my IP address, but I was still able to reach other hosts in the same network. It happens too many times to me and I did try to search but no luck to explain it. It actually does show up in "ip addr" command. These are my configuration for a static IP address, "ifconfig" and "ip addr"

This one is a ubuntu version 14.04 installed on physical server. jessie/sid (Linux openstack 3.19.0-56-generic #62~14.04.1-Ubuntu SMP Fri Mar 11 11:03:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux)

ifconfig, ip addr output

Thank you so much!

root@openstack:/home/stack# ip address list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 169.254.169.254/32 scope link lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br100 state UP group default qlen 1000
    link/ether 0c:c4:7a:76:1b:08 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::ec4:7aff:fe76:1b08/64 scope link 
       valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0c:c4:7a:76:1b:09 brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether fa:26:3a:76:77:1c brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
5: br100: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 0c:c4:7a:76:1b:08 brd ff:ff:ff:ff:ff:ff
    inet 10.11.12.1/24 brd 10.11.12.255 scope global br100
       valid_lft forever preferred_lft forever
    inet 192.168.20.46/24 brd 192.168.20.255 scope global br100
       valid_lft forever preferred_lft forever
    inet 192.168.20.49/32 scope global br100
       valid_lft forever preferred_lft forever
    inet6 fe80::8c2f:b6ff:fe58:4b11/64 scope link 
       valid_lft forever preferred_lft forever
10: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br100 state UNKNOWN group default qlen 500
    link/ether fe:16:3e:88:1e:51 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc16:3eff:fe88:1e51/64 scope link 
       valid_lft forever preferred_lft forever
13: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br100 state UNKNOWN group default qlen 500
    link/ether fe:16:3e:b4:69:7e brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc16:3eff:feb4:697e/64 scope link 
       valid_lft forever preferred_lft forever
17: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br100 state UNKNOWN group default qlen 500
    link/ether fe:16:3e:b9:d7:4a brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc16:3eff:feb9:d74a/64 scope link 
       valid_lft forever preferred_lft forever




root@openstack:/home/stack# ifconfig
br100     Link encap:Ethernet  HWaddr 0c:c4:7a:76:1b:08  
          inet addr:10.11.12.1  Bcast:10.11.12.255  Mask:255.255.255.0
          inet6 addr: fe80::8c2f:b6ff:fe58:4b11/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:627132 errors:0 dropped:0 overruns:0 frame:0
          TX packets:522836 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3074313781 (3.0 GB)  TX bytes:308312132 (308.3 MB)

em1       Link encap:Ethernet  HWaddr 0c:c4:7a:76:1b:08  
          inet6 addr: fe80::ec4:7aff:fe76:1b08/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2884361 errors:0 dropped:24125 overruns:0 frame:0
          TX packets:816202 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3881966559 (3.8 GB)  TX bytes:181453552 (181.4 MB)
          Memory:fb200000-fb27ffff 

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:65536  Metric:1
          RX packets:45652477 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45652477 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:30760291923 (30.7 GB)  TX bytes:30760291923 (30.7 GB)

virbr0    Link encap:Ethernet  HWaddr fa:26:3a:76:77:1c  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vnet0     Link encap:Ethernet  HWaddr fe:16:3e:88:1e:51  
          inet6 addr: fe80::fc16:3eff:fe88:1e51/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:487 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58390 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:63154 (63.1 KB)  TX bytes:4422625 (4.4 MB)

vnet1     Link encap:Ethernet  HWaddr fe:16:3e:b4:69:7e  
          inet6 addr: fe80::fc16:3eff:feb4:697e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13333 errors:0 dropped:0 overruns:0 frame:0
          TX packets:63555 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:1042620 (1.0 MB)  TX bytes:29097792 (29.0 MB)

vnet2     Link encap:Ethernet  HWaddr fe:16:3e:35:95:a0  
          inet6 addr: fe80::fc16:3eff:fe35:95a0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5086 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5567 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:450420 (450.4 KB)  TX bytes:8912581 (8.9 MB)


root@openstack:/home/stack# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto em1
iface em1 inet static
    address 192.168.20.46
    netmask 255.255.255.0
    network 192.168.20.0
    broadcast 192.168.20.255
    gateway 192.168.20.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 8.8.8.8
6
  • What problem are you having? Have you done investigation using Google, which finds pages like this ubuntuforums.org/showthread.php?t=2232263 ? What environment is this - home PC, virtual server (which kind), AWS, etc?
    – Tim
    Apr 12, 2016 at 2:43
  • I already said in my post: the command "ifconfig" did not show my ip address which was already configured statically, but I was still able to see it in "ip addr" command. I will add more info about the environment in the question, and I did a lot of Google search before asking this question.
    – Long
    Apr 12, 2016 at 2:49
  • Don't post screenshots of terminals like that. Copy-paste the output into the question and use the code formatting feature for it. Also your question and screenshots have contradictory information about the output of ip addr. Which is it?
    – kasperd
    Apr 12, 2016 at 10:06
  • @kasperd thanks for your suggestion. In my question I was asking about the output of "ifconfig", not "ip addr". I also posted the screenshot of "ip addr" just to emphasize the point that the correct IP address was set but did not show up in "ifconfig" command.
    – Long
    Apr 12, 2016 at 10:22
  • @Long Without knowing the actual output of ip addr we don't know how the interface is actually configured, and thus we cannot explain the output of ifconfig either.
    – kasperd
    Apr 12, 2016 at 10:25

1 Answer 1

-1

ifconfig is deprecated. See this article for more information. The modern equivalent of ifconfig on its own is

ip address list
3
  • 1
    I see, so it's equivalent to "ip addr". I could not vote-up your answer as my reputation is below 15. If no one provides further explanation, I will make yours an an answer. Thanks
    – Long
    Apr 12, 2016 at 2:58
  • This answer does not explain the output of ip addr given in the question. And the linked question is about cases where multiple addresses are assigned to the same interface. But in this question there is only one.
    – kasperd
    Apr 12, 2016 at 10:08
  • I may not have answered exactly what the OP asked, but I've given them the information they need - that ifconfig is deprecated and I've provided the command they should use.
    – Tim
    Apr 12, 2016 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .