[CentOS] unable to add IP address to eth0:0 eth0:1 etc

Ross S. W. Walker rwalker at medallion.com
Fri Sep 7 14:25:17 UTC 2007


From: centos-bounces at centos.org 
[mailto:centos-bounces at centos.org] On Behalf Of Ray Leventhal
> 
> <snip>
> >> if you'd explain, I'd be grateful.
> >>     
> >
> > You will need to add the routes for the other subnet in your routing
> > table as such.
> >
> > route add -net XX.XX.XX.0 netmask 255.255.255.0 eth0
> >
> > I believe there is a place to add static routes in one of 
> the startup
> > scripts (besides rc.local), but forget where it is, I think if you
> > configure ifcfg-eth0:X sub-interfaces scripts ifup will create these
> > routes.
> >
> > -Ross
> >
> >
> >   
> Hi Ross et al,
> 
> I'm getting an error on adding the route.  The machine's base IP is in
> the xx.xx.16.x /24.  The additional IPs are in another /24.  Base is
> physical, the others are virtual hosts.
> 
> The error on adding routes is:
> route: netmask doesn't match route address
> Usage: route [-nNvee] [-FC] [<AF>]           List kernel 
> routing tables
>        route [-v] [-FC] {add|del|flush} ...  Modify routing 
> table for AF.
> 
>        route {-h|--help} [<AF>]              Detailed usage syntax for
> specified AF.
>        route {-V|--version}                  Display 
> version/author and
> exit.
> 
>         -v, --verbose            be verbose
>         -n, --numeric            don't resolve names
>         -e, --extend             display other/more information
>         -F, --fib                display Forwarding Information Base
> (default)
>         -C, --cache              display routing cache instead of FIB
> 
>   <AF>=Use '-A <af>' or '--<af>'; default: inet
>   List of possible address families (which support routing):
>     inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
>     netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
>     x25 (CCITT X.25)
> 
> I know i'm probably being thick here, and I do appreciate the
> assistance.  What am I missing?
> 
> Thanks again so very much,
> ~Ray

Hmmm, tested it here and it worked for me.

Are all networks defined on that interface /24?

Here is what I did here:

eth0 already configured for 10.1.1.225/24

[root at mfg-nyc-iscsi2 snmp]# ifconfig eth0:0 192.168.1.134 netmask 255.255.255.0
[root at mfg-nyc-iscsi2 snmp]# route add -net 192.168.1.0 netmask 255.255.255.0 eth0
[root at mfg-nyc-iscsi2 snmp]# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     *               255.255.255.0   U         0 0          0 eth0
10.1.1.0        *               255.255.255.0   U         0 0          0 eth0
172.16.24.0     *               255.255.255.0   U         0 0          0 bond0
172.16.25.0     *               255.255.255.0   U         0 0          0 bond1
169.254.0.0     *               255.255.0.0     U         0 0          0 eth0
default         rt1.nyc.mfg.prv 0.0.0.0         UG        0 0          0 eth0
[root at mfg-nyc-iscsi2 snmp]# 

-Ross

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.




More information about the CentOS mailing list