Configuring Network Interface in Solaris 10

When I first got my hands on a Solaris machine, I did not even know how to configure the IP address of the network device. It was difficult because you had to do “everything” yourself.

  1. Determine the network interface to configure the IP address
  2. “Plumb” the interface to implement the TCP/IP stack
  3. Configure the IP address for the network interface

I had virtual network device assigned to the box but I could not see the network interface when I run “ifconfig -a”.

# dladm show-dev
vnet0 link: unknown speed: 0 Mbps duplex: unknown
vnet1 link: unknown speed: 0 Mbps duplex: unknown

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000

Once I “plumb” the network interface, the virtual network device was able to see when I run the ifconfig -a command.
# ifconfig vnet0 plumb
# ifconfig vnet1 plumb
# dladm show-dev
vnet0 link: up speed: 0 Mbps duplex: unknown
vnet1 link: up speed: 0 Mbps duplex: unknown
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
vnet0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 0.0.0.0 netmask 0
ether 0:14:4f:fa:e0:3f
vnet1: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
inet 0.0.0.0 netmask 0
ether 0:14:4f:fa:56:2a

To temporary configure the IP address for the network interface;

# ifconfig vnet0 192.168.10.1 netmask 255.255.255.0 broadcast + up

To configure a permanent static IP address that will sustain a reboot;

  1. Ensure default gateway is configured in /etc/defaultrouter
  2. Ensure netmask is configured in /etc/netmasks
  3. Ensure /etc/hostname.vnet0 is configured with the static IP address

# cat /etc/defaultrouter
<default gateway>

# cat /etc/netmasks
<network ID> <subnet-mask>

# cat hostname.vnet0
<ip address>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s