Hi,
You need to issue two commands:
/sbin/ifconfig eth0:0 xxx.xxx.xxx.xxx /sbin/route add -host xxx.xxx.xxx.xxx dev eth0
For example:
/sbin/ifconfig eth0:0 172.16.1.199 /sbin/route add -host 172.16.1.199 dev eth0
You can even assign multiple aliases to one NIC (One of my servers has about 10 ip addresses):
For example:
/sbin/ifconfig eth0:0 172.16.1.199 /sbin/route add -host 172.16.1.199 dev eth0
/sbin/ifconfig eth0:1 172.16.1.198 /sbin/route add -host 172.16.1.198 dev eth0
/sbin/ifconfig eth0:2 172.16.1.197 /sbin/route add -host 172.16.1.197 dev eth0
and so on.....
You should write an startup script to execute these commands at boot time, because after a reboot the aliases are forgotten.
Thom van der Boon E-Mail: Thom.van.der.Boon@vdb.nl
=====
Thom.H. van der Boon b.v. Havens 563 Jan Evertsenweg 2-4 NL-3115 JA Schiedam Tel.: +31 (0)10 4272727 Fax: +31 (0)10 4736620 E-Mail: info@vdb.nl Home Page: http://www.vdb.nl/
joao.c.medeiros@gmail.com 24.06.2005 00:28:01 >>>
Hi all,
I've been trying to add a second ip address to one of my network cards in my CentOS box. I've defined the alias on top of eth1 which has become eth1:1 with a different ip address.
I can ping the new ip address both from my linux box as well as from my Windoze desktop, however I can only access my Apache web server setup as a virtual host from within the Linux box. If I try to access it from the desktop I get an "Operation Timeout..." error.
I'm sure I missed out something really basic. Browsed Google and the CentOS mailing list (plus RH) and can't figure it out. Networking is not one of my best subjects... Someone care to shed some light or point me to a fairly decent link out there which covers this topic?
TIA, --JM
João Medeiros Linux User 381318
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos