Re: Loopback address to eth0 interface and rooting goes wrong

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Varun Chandramohan <varunc@xxxxxxxxxxxxxxxxxx> writes:

 > Can you send it to net-dev also?

Done.

here's a way to see what really happens:


dhcp232:~# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:aa:00:ff:00:ff brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.232/24 brd 192.168.3.255 scope global eth0
    inet6 2001:16d8:ffb4:0:2aa:ff:feff:ff/64 scope global dynamic 
       valid_lft 2591971sec preferred_lft 604771sec
    inet6 fe80::2aa:ff:feff:ff/64 scope link 
       valid_lft forever preferred_lft forever
dhcp232:~# ifconfig eth0 127.0.0.1
dhcp232:~# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:aa:00:ff:00:ff brd ff:ff:ff:ff:ff:ff
    inet 127.0.0.1/8 brd 127.255.255.255 scope host eth0
    inet6 2001:16d8:ffb4:0:2aa:ff:feff:ff/64 scope global dynamic 
       valid_lft 2591951sec preferred_lft 604751sec
    inet6 fe80::2aa:ff:feff:ff/64 scope link 
       valid_lft forever preferred_lft forever
dhcp232:~# ifconfig eth0 192.168.3.232
dhcp232:~# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:aa:00:ff:00:ff brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.232/24 brd 192.168.3.255 scope host eth0
    inet6 2001:16d8:ffb4:0:2aa:ff:feff:ff/64 scope global dynamic 
       valid_lft 2591933sec preferred_lft 604733sec
    inet6 fe80::2aa:ff:feff:ff/64 scope link 
       valid_lft forever preferred_lft forever



Notice how the scope changes from "global" to "host" when configuring
127.0.0.1, and just never changes back.  It will stay that way forever,
or until something changes the scope or deletes the address.

Deleting the addresss and re-adding it will work around the problem:

dhcp232:~# ip addr del 192.168.3.232/24 dev eth0
dhcp232:~# ifconfig eth0 192.168.3.232
dhcp232:~# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:aa:00:ff:00:ff brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.232/24 brd 192.168.3.255 scope global eth0
    inet6 2001:16d8:ffb4:0:2aa:ff:feff:ff/64 scope global dynamic 
       valid_lft 2591963sec preferred_lft 604763sec
    inet6 fe80::2aa:ff:feff:ff/64 scope link 
       valid_lft forever preferred_lft forever

The address can also be deleted using 

dhcp232:~# ifconfig eth0 0

if you don't have iproute2 installed.


Bjørn
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux