How to create an ethernet subinterface on RHEL 5 / CentOS 5
Having one ethernet adapter with multpile IP addresses is sometimes handy. For instance, when you want to have more than one SSL web site running.
Assuming you have a functioning interface, here is how to set this up for RHEL 5 / CentOS 5.
In the example I use eth0 as the existing “main” device.
The process:
Go to the directory with the networking scripts
cd /etc/sysconfig/network-scripts
Copy the original network script for the interface
cp ifcfg-eth0 ifcfg-eth0:1
Edit ifcfg-eth0:1 and:
Change the device name
change DEVICE=eth0 to DEVICE=eth0:1
Change the IP address
change IPADDR=[current value] to IPADDR=[ip address for subinterface]
Save the file
Restart the network service.
service network restart
When all went well, you should now have an extra interface showing in ifconfig.
Good luck!
Leave a Reply
You must be logged in to post a comment.