Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 216 - eth aliases don't work for IPs on different subnets
Summary: eth aliases don't work for IPs on different subnets
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 5.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
: 739 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 1998-11-29 00:06 UTC by Marc MERLIN
Modified: 2014-03-17 02:08 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-03-15 23:20:26 UTC

Attachments (Terms of Use)

Description Marc MERLIN 1998-11-29 00:06:45 UTC
This is not a new bug, I'm just dumping my old bug reports
into your new database.

Whoever designed the IP aliases support made the assumption
that they are only used for web servers. In other words, the
initscript add host routes to those aliases.

After several hours of going through all the network
scripts, I used this fix. It's not necessarly great, but
it works. The patch is small enough to be applied by hand,
so I'm not sending a copy by mail.
It checks if there is already a route to the network the
alias belongs to, and adds one if it isn't the case

--- ifup.redhat Sat Aug 29 18:43:24
+++ ifup        Sat Aug 29 19:18:46
@@ -130,7 +130,9

     ifconfig ${DEVICE} ${MACADDR:+hw ether $MACADDR}
${IPADDR} \\
       netmask ${NETMASK} broadcast
-    if [ "$ISALIAS" = no ] ;
+    # Setup route to aliases if they're on a different
+    if [ "$ISALIAS" = no -o z"`route -n | sed "s/ .*//" |
grep ${NETWORK}`" = z
 ] ;
        route add -net ${NETWORK} netmask ${NETMASK}

        route add -host ${IPADDR} ${DEVICE}

Note that this will only work if aliased interfaces go
through ifup
This means that I had to patch ifup-aliases to completely
bypass linuxconf because there was no simple way to fix the

I think that the way you handle aliases is plain broken:
aliases should be normal devices that go through ifup.
However, at alias creation time, the GUI should give the
option of creating a "web style" alias and put a netmask of
Initscripts could then treat the alias like a normal
interface (just like before you modified
/etc/rc.d/init.d/network to remove aliases with a egrep -v

Obviously, most of those problems go away with 2.1.x kernels
since the route to the local subnet is created
automatically. I guess that not fixing this and doing a
rewrite for 2.2 would be reasonable.

Comment 1 Jeff Johnson 1999-01-20 14:46:59 UTC
*** Bug 739 has been marked as a duplicate of this bug. ***

If you have an alias device which is on another network than
the 'primary' device, ifcfg incorrectly STILL uses
'route add -host' instead of 'route add -net'.

For example, if eth0 is and eth0:1 is, ifup will NOT add a route for the

------- Additional Comments From  01/08/99 20:18 -------
I was able to verify this bug as follows

Created a ifcfg-eth0 file with the following

the an ifcfg-eth0:0 with the following


After rebooting the devices were created correctly. But the routing
information showed that the interface was added as a host
instead of being added as a network as it should be

Destination   Gateway   Genmask        Flags Metric Ref   Use   Iface   *   UH     0    0     0    eth0:0   *     U      0    0     0    eth0     *         U      0    0     0    lo

I have assigned this to a developer.

------- Additional Comments From  01/08/99 23:43 -------
This is a duplicate of #216

Comment 2 Bill Nottingham 1999-03-15 23:20:59 UTC
fixed in initscripts-3.95-1.

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