Bug 970680 - Try to delete an IPv4 alias adds an extra and unexpected static route
Try to delete an IPv4 alias adds an extra and unexpected static route
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-tools (Show other bugs)
6.4
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Jiri Popelka
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-04 11:00 EDT by charlie.vuillemez
Modified: 2013-11-05 10:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-05 10:11:24 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description charlie.vuillemez 2013-06-04 11:00:29 EDT
Description of problem:
When trying to delete an IPv4 alias, unexpected static route is added.
Issue occurs on very particular condition.

Version-Release number of selected component (if applicable):
Reproducible on RHEL5/6 i686/x86_64
with net-tools-1.60-110.el6_2.x86_64

How reproducible:

- First step, check IP routes:

[root@tstrhel6~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.200.100.0    0.0.0.0         255.255.252.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         10.200.100.1    0.0.0.0         UG        0 0          0 eth0

- Second, delete an IP alias:

[root@tstrhel6~]# ip addr del 10.200.100.100 dev eth0:1
Warning: Executing wildcard deletion to stay compatible with old scripts.
         Explicitly specify the prefix length (10.200.100.100/32) to avoid this warning.
         This special behaviour is likely to disappear in furth

- After that, IP alias is deleted but if you think it's not the case (because the warning misled you..) and try another command like this one:

[root@tstrhel6~]# ifconfig eth0:1 10.200.100.100 delete
delete: Unknown host
ifconfig: `--help' gives usage information.

Then a static route is added, in the associated network of the IP you wanted to delete ..  This occurs even so the previously entered command syntax was wrong ! :

[root@tstrhel6~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.200.100.0    0.0.0.0         255.255.252.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
10.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 eth0
0.0.0.0         10.200.100.1    0.0.0.0         UG        0 0          0 eth0

Issue is easily reproducible, but "works" only if all steps are applied.
Because of this unexpected route, outside network become unreachable.
I'm aware than second step is purely a mistake, but why this result which have no relation with IP alias ?


Expected results:

Alias is deleted, and wrong syntax have no consequences.
Comment 2 Jiri Popelka 2013-06-04 11:10:47 EDT
(In reply to charlie.vuillemez from comment #0)
> - Second, delete an IP alias:
> [root@tstrhel6~]# ip addr del 10.200.100.100 dev eth0:1

If I understand it correctly the problem occurs when using 'ip' command, which is part of iproute package, reassigning.
Comment 3 charlie.vuillemez 2013-06-04 11:17:46 EDT
(In reply to Jiri Popelka from comment #2)
> (In reply to charlie.vuillemez from comment #0)
> > - Second, delete an IP alias:
> > [root@tstrhel6~]# ip addr del 10.200.100.100 dev eth0:1
> 
> If I understand it correctly the problem occurs when using 'ip' command,
> which is part of iproute package, reassigning.

Yes but 3rd step is with ifconfig.
Comment 4 Petr Šabata 2013-06-04 13:05:27 EDT
Could you post the netstat output after using the 'ip' tool too?
Comment 5 charlie.vuillemez 2013-06-04 15:36:47 EDT
In fact it seems to be an issue *or not* with ifconfig cmd.

-first I check netstat & ifconfig outputs:
(test realized on another server)

[root@tstvm6 ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.222.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         192.168.222.1   0.0.0.0         UG        0 0          0 eth0
[root@tstvm6 ~]# ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:80:88:2A  
          inet addr:192.168.222.10  Bcast:192.168.222.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe80:882a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4158 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1992 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:348878 (340.7 KiB)  TX bytes:307798 (300.5 KiB)

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: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)


- Then I try to delete alias (which no longer exist), with wrong way:

[root@tstvm6 ~]# ifconfig eth0:1 10.200.100.100 delete
delete: Unknown host
ifconfig: `--help' gives usage information.
[root@tstvm6 ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.222.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
10.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 eth0
0.0.0.0         192.168.222.1   0.0.0.0         UG        0 0          0 eth0

Route is added, exactly in the same way than if I would execute "ifconfig eth0:1 10.200.100.100".
I understand that "delete" word is unknown from ifconfig program, but first address is applied.

So maybe not a bug ? (with an obsolete program ?)
I reassign to net-tools team.
Comment 6 RHEL Product and Program Management 2013-10-13 19:31:08 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 7 Petr Šabata 2013-10-31 02:31:31 EDT
Assigning to the component maintainer.
Comment 8 Jaromír Končický 2013-11-05 10:11:24 EST
I investigated this a bit and consider it NOTABUG.
The "unsexpected route" (according to you) is added after running the ifconfig command. But I'd say it's rather expected.
'ifconfig interface address' assigns address to the interface. When this address is assigned, its prefix is automatically added into routing tables.
Say, you run 'ifconfig eth0:1 10.10.10.20', then new alias eth0:1 is created with assigned address 10.10.10.20 and 10.0.0.0 is added into routing table. When you remove the alias by 'ifconfig eth0:1 down', then also 10.0.0.0 is removed from routing table.
ifcongig doesn't know any keyword 'delete' and considers it as hostname. Because it is invalid hostname, it takes the address instead.

Note You need to log in before you can comment on or make changes to this bug.