Archive for January, 2010

Virtual interfaces under HPUX 10.20

Friday, January 22nd, 2010

To define do as you (almost) would do on HPUX 11.00+

sudo vi /etc/rc.config.d/netconf
RARPD=0
INTERFACE_NAME[0]=lan2
IP_ADDRESS[0]=10.17.137.227
LANCONFIG_ARGS[0]=ether
SUBNET_MASK[0]=255.255.255.0
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]=lan2
IP_ADDRESS[1]=10.17.137.226
LANCONFIG_ARGS[1]=ether
SUBNET_MASK[1]=255.255.255.0
DHCP_ENABLE[1]=0
sudo /sbin/init.d/net start

To remove it again

sudo ifalias lan2 del 10.17.137.226

Virtual interfaces under linux.

Friday, January 15th, 2010

As with other operating systems it is possible to bring multiple service ip-addresses online under one physical NIC under linux. This is just at brief howto on doing it.

ubuntu:

sudo vi /etc/network/interfaces
# The primary network interface
auto eth0
iface eth0 inet static
 address 192.168.1.2
 netmask 255.255.255.0
 network 192.168.1.0
 broadcast 192.168.1.255
 gateway 192.168.1.1
# The first virtual interface
auto eth0:1
iface eth0:1 inet static
 address 192.168.1.100
 netmask 255.255.255.0
 broadcast 192.168.1.255
 gateway 192.168.1.1

After you have edited that file, issue

sudo /etc/init.d/networking restart

RHEL (Redhat)/Centos:

cd /etc/sysconfig/network-scripts
 sudo cp ifcfg-eth0 ifcfg-eth0:0
 sudo vi ifcfg-eth0:0

 cat ifcfg-eth0:0

 > DEVICE=eth0:0
 > BOOTPROTO=none
 > IPADDR=192.168.1.100
 >  NETMASK=255.255.255.0
 > GATEWAY=192.168.100
 > ONBOOT=yes

After that, issue

sudo service network restart