Ray Leventhal
2007-Sep-07 13:01 UTC
[CentOS] unable to add IP address to eth0:0 eth0:1 etc
Hi all, I need to (quickly!grrr) update IP addresses for which a given machine will answer. I did this: /sbin/ifconfig eth0:0 xx.xx.xx.10 netmask 255.255.255.0 /sbin/ifconfig eth0:1 xx.xx.xx.11 netmask 255.255.255.0 /sbin/ifconfig eth0:2 xx.xx.xx.30 netmask 255.255.255.0 /sbin/ifconfig eth0:3 xx.xx.xx.31 netmask 255.255.255.0 /sbin/ifconfig eth0:4 xx.xx.xx.13 netmask 255.255.255.0 /sbin/ifconfig eth0:5 xx.xx.xx.15 netmask 255.255.255.0 /sbin/ifconfig eth0:6 xx.xx.xx.20 netmask 255.255.255.0 /sbin/ifconfig eth0:7 xx.xx.xx.21 netmask 255.255.255.0 /sbin/ifconfig eth0:8 xx.xx.xx.22 netmask 255.255.255.0 but on looking at the output of /sbin/ifconfig, I see this: [root at sunspot ray]# /sbin/ifconfig eth0 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:64.135.16.15 Bcast:64.135.16.255 Mask:255.255.255.0 inet6 addr: fe80::200:c5ff:fec2:1b01/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5491775 errors:0 dropped:0 overruns:0 frame:0 TX packets:962501 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:436018277 (415.8 MiB) TX bytes:156248463 (149.0 MiB) Interrupt:12 Base address:0xcf00 eth0:0 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.10 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:1 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.11 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:2 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.30 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:3 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.31 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:4 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.13 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:5 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.15 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:6 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.20 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:7 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.21 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 eth0:8 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 inet addr:xx.xx.xx.22 Bcast:xx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xcf00 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:5744 errors:0 dropped:0 overruns:0 frame:0 TX packets:5744 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:591811 (577.9 KiB) TX bytes:591811 (577.9 KiB) And this, in /var/log/messages [root at sunspot ray]# tail /var/log/messages Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address record for xx.xx.xx.15 on eth0. Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address record for xx.xx.xx.20 on eth0. Sep 7 06:50:31 sunspot avahi-daemon[2203]: Withdrawing address record for xx.xx.xx.20 on eth0. Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address record for xx.xx.xx.20 on eth0. Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address record for xx.xx.xx.21 on eth0. Sep 7 06:50:31 sunspot avahi-daemon[2203]: Withdrawing address record for xx.xx.xx.21 on eth0. Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address record for xx.xx.xx.21 on eth0. Sep 7 06:50:33 sunspot avahi-daemon[2203]: Registering new address record for xx.xx.xx.22 on eth0. Sep 7 06:50:33 sunspot avahi-daemon[2203]: Withdrawing address record for xx.xx.xx.22 on eth0. Sep 7 06:50:33 sunspot avahi-daemon[2203]: Registering new address record for xx.xx.xx.22 on eth0. How can I get my NIC to accept traffic for these IPs? Thanks In Advance, ~Ray
Karanbir Singh
2007-Sep-07 13:09 UTC
[CentOS] unable to add IP address to eth0:0 eth0:1 etc
Ray Leventhal wrote:> Hi all, > > I need to (quickly!grrr) update IP addresses for which a given machine > will answer. > > I did this: > > /sbin/ifconfig eth0:0 xx.xx.xx.10 netmask 255.255.255.0you might want to investigate /sbin/ip - its been around for a few years now, no reason why people should not be using that these days :) -- Karanbir Singh : http://www.karan.org/ : 2522219 at icq
Dear Ray, Please assure me that: /sbin/ifconfig eth0:0 xx.xx.xx.10 netmask 255.255.255.0 Is this the valid netmask "255.255.255.0" for static IP address for this machine you mentioned???? it will be "ifconfig eth0:0 xxxxx netmask 255.255.255.255" Regards, Umair Shakil ETD On 9/7/07, Ray Leventhal <centos at swhi.net> wrote:> > Hi all, > > I need to (quickly!grrr) update IP addresses for which a given machine > will answer. > > I did this: > > /sbin/ifconfig eth0:0 xx.xx.xx.10 netmask 255.255.255.0 > /sbin/ifconfig eth0:1 xx.xx.xx.11 netmask 255.255.255.0 > /sbin/ifconfig eth0:2 xx.xx.xx.30 netmask 255.255.255.0 > /sbin/ifconfig eth0:3 xx.xx.xx.31 netmask 255.255.255.0 > /sbin/ifconfig eth0:4 xx.xx.xx.13 netmask 255.255.255.0 > /sbin/ifconfig eth0:5 xx.xx.xx.15 netmask 255.255.255.0 > /sbin/ifconfig eth0:6 xx.xx.xx.20 netmask 255.255.255.0 > /sbin/ifconfig eth0:7 xx.xx.xx.21 netmask 255.255.255.0 > /sbin/ifconfig eth0:8 xx.xx.xx.22 netmask 255.255.255.0 > > > but on looking at the output of /sbin/ifconfig, I see this: > > [root at sunspot ray]# /sbin/ifconfig > eth0 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:64.135.16.15 Bcast:64.135.16.255 Mask:255.255.255.0 > inet6 addr: fe80::200:c5ff:fec2:1b01/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:5491775 errors:0 dropped:0 overruns:0 frame:0 > TX packets:962501 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:436018277 (415.8 MiB) TX bytes:156248463 (149.0 MiB) > Interrupt:12 Base address:0xcf00 > > eth0:0 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.10 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:1 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.11 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:2 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.30 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:3 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.31 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:4 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.13 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:5 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.15 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:6 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.20 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:7 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.21 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:8 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.22 Bcast:xx.xx.xx.255 Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > 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:5744 errors:0 dropped:0 overruns:0 frame:0 > TX packets:5744 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:591811 (577.9 KiB) TX bytes:591811 (577.9 KiB) > > > And this, in /var/log/messages > [root at sunspot ray]# tail /var/log/messages > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.15 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.20 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Withdrawing address record > for xx.xx.xx.20 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.20 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.21 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Withdrawing address record > for xx.xx.xx.21 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.21 on eth0. > Sep 7 06:50:33 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.22 on eth0. > Sep 7 06:50:33 sunspot avahi-daemon[2203]: Withdrawing address record > for xx.xx.xx.22 on eth0. > Sep 7 06:50:33 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.22 on eth0. > > > How can I get my NIC to accept traffic for these IPs? > > Thanks In Advance, > ~Ray > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20070907/733a5ce6/attachment.html>
Ray Leventhal
2007-Sep-07 13:15 UTC
[CentOS] unable to add IP address to eth0:0 eth0:1 etc
> Dear Ray, > > Please assure me that: > > /sbin/ifconfig eth0:0 xx.xx.xx.10 netmask 255.255.255.0 > <http://255.255.255.0/> > > Is this the valid netmask " 255.255.255.0 <http://255.255.255.0>" for > static IP address for this machine > you mentioned???? > > it will be "ifconfig eth0:0 xxxxx netmask 255.255.255.255 > <http://255.255.255.255> " > > Regards, > > Umair Shakil > ETD ><snip> Absolutely, that is the correct netmask. It is a /24
Ross S. W. Walker
2007-Sep-07 13:21 UTC
[CentOS] unable to add IP address to eth0:0 eth0:1 etc
From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On Behalf Of Ray Leventhal> > Hi all, > > I need to (quickly!grrr) update IP addresses for which a given machine > will answer. > > I did this: > > /sbin/ifconfig eth0:0 xx.xx.xx.10 netmask 255.255.255.0 > /sbin/ifconfig eth0:1 xx.xx.xx.11 netmask 255.255.255.0 > /sbin/ifconfig eth0:2 xx.xx.xx.30 netmask 255.255.255.0 > /sbin/ifconfig eth0:3 xx.xx.xx.31 netmask 255.255.255.0 > /sbin/ifconfig eth0:4 xx.xx.xx.13 netmask 255.255.255.0 > /sbin/ifconfig eth0:5 xx.xx.xx.15 netmask 255.255.255.0 > /sbin/ifconfig eth0:6 xx.xx.xx.20 netmask 255.255.255.0 > /sbin/ifconfig eth0:7 xx.xx.xx.21 netmask 255.255.255.0 > /sbin/ifconfig eth0:8 xx.xx.xx.22 netmask 255.255.255.0 > > > but on looking at the output of /sbin/ifconfig, I see this: > > [root at sunspot ray]# /sbin/ifconfig > eth0 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:64.135.16.15 Bcast:64.135.16.255 > Mask:255.255.255.0 > inet6 addr: fe80::200:c5ff:fec2:1b01/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:5491775 errors:0 dropped:0 overruns:0 frame:0 > TX packets:962501 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:436018277 (415.8 MiB) TX bytes:156248463 > (149.0 MiB) > Interrupt:12 Base address:0xcf00 > > eth0:0 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.10 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:1 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.11 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:2 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.30 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:3 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.31 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:4 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.13 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:5 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.15 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:6 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.20 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:7 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.21 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > eth0:8 Link encap:Ethernet HWaddr 00:00:C5:C2:1B:01 > inet addr:xx.xx.xx.22 Bcast:xx.xx.xx.255 > Mask:255.255.255.0 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > Interrupt:12 Base address:0xcf00 > > 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:5744 errors:0 dropped:0 overruns:0 frame:0 > TX packets:5744 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:591811 (577.9 KiB) TX bytes:591811 (577.9 KiB) > > > And this, in /var/log/messages > [root at sunspot ray]# tail /var/log/messages > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.15 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.20 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Withdrawing address record > for xx.xx.xx.20 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.20 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.21 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Withdrawing address record > for xx.xx.xx.21 on eth0. > Sep 7 06:50:31 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.21 on eth0. > Sep 7 06:50:33 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.22 on eth0. > Sep 7 06:50:33 sunspot avahi-daemon[2203]: Withdrawing address record > for xx.xx.xx.22 on eth0. > Sep 7 06:50:33 sunspot avahi-daemon[2203]: Registering new address > record for xx.xx.xx.22 on eth0. > > > How can I get my NIC to accept traffic for these IPs?If the secondaries are on a different subnet then the primary then you will need to add routing entries for those subnets pointing out eth0. -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.
Karanbir Singh
2007-Sep-07 13:25 UTC
[CentOS] unable to add IP address to eth0:0 eth0:1 etc
Ray Leventhal wrote:> Hi all, > > I need to (quickly!grrr) update IP addresses for which a given machine > will answer.for f in 10 11 30 31 13 15 20 21 22 ; do ip addr add dev eth0 xx.xx.xx.${f}/24 ; done; ip addr ls; ip route ls; check firewall to make sure traffic is allowed in/out for those IP's -- Karanbir Singh : http://www.karan.org/ : 2522219 at icq