Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Second IP Address

Status
Not open for further replies.

mufka

ISP
Dec 18, 2000
587
US
I am using Redhat 7.3 and I'd like to add a second IP address to eth0. The ip is on a different subnet. Is this possible?
 
Yes...

ifconfig eth0 128.2.3.4 netmask 255.255.0.0

ifconfig eth0:0 192.168.1.100 netmask 255.255.255.0

I would add these commands to one of your startup scripts so that you won't lose your changes after a reboot. I used /etc/rc.d/rc.local for the second IP and /etc/sysconfig/network-scripts/ifcfg-eth0 for the first IP. I'm not sure if creating an ifcfg-eth0:0 file would work or not.


-Chris
 
Creating the file ifcfg-eth0:1 would work. You might want to add the route for that ip as well. An ex:
route add -host 192.168.1.100 netmask 255.255.255.0 Rninja

smlogo.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top