I was doing some dhcp tasks for homework, and in one exercise I needed to release the IP on one client, to then in the server with tcpdump capture the packages describing the whole DHCP communication.
This worked just fine of course, the thing is that my client got assigned 2 IPs, the old one and the new one.
I don't really need to know this for my tasks but I was just curious about why an interface can have double IPs, and how could I release just one of them.
I'll show you the ip a
output of the client for further info
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:8d:c0:4d brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
valid_lft 81584sec preferred_lft 81584sec
inet6 fe80::a00:27ff:fe8d:c04d/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:e8:5c:2a brd ff:ff:ff:ff:ff:ff
inet 192.168.100.10/24 brd 192.168.100.255 scope global dynamic eth1
valid_lft 16802sec preferred_lft 16802sec
inet 192.168.100.11/24 brd 192.168.100.255 scope global secondary dynamic eth1
valid_lft 19310sec preferred_lft 19310sec
inet6 fe80::a00:27ff:fee8:5c2a/64 scope link
valid_lft forever preferred_lft forever
PS
I wondered if maybe the old IP just wouldn't work now, and maybe ip a
was just showing a kind of "history", but both IPs work. But still, I don't know why this is allowed.