Thursday, February 8, 2007

Solaris: Virtual Interface Adding/Removing

(Source :

Virtual interfaces allow a single Ethernet interface to listen on additional IP addresses.

Given an ethernet interface hme0 (use ifconfig -a to identify the names of your interfaces), you can create a subinterface called hme0:1 with the following command:
# /sbin/ifconfig hme0:1 plumb

You can set the IP address of the interface to and turn on the interface with the following command:
# /sbin/ifconfig hme0:1 up

# /sbin/ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet netmask ff000000
hme0: flags=1000843 mtu 1500 index 2
inet netmask ffffff00 broadcast
ether 9:0:21:aa:be:5f
hme0:1: flags=1000843 mtu 1500 index 2
inet netmask ffff0000 broadcast

Unless you do some additional nonstandard things in your network, all of the subinterfaces on a physical interface need to be in the same subnet.

To make the virtual interface persist following a reboot, you can add the ip address or hostame from /etc/hosts in the file /etc/hostname.hme0:1

Removing the virtual interface from Solaris:

Solaris allows multiple virtual or logical interfaces to exist with different IP addresses on the same physical interface. Virtual interfaces are created or plumbed up using the plumb directive in ifconfig. They are unplumbed using the unplumb directive.

To remove the virtual interface eri1:7, run the following command as root:
# ifconfig eri1:7 unplumb

No comments:

© Jadu Saikia