Tuesday, November 06, 2012

Network Interfaces with Vlan Tags in Solaris 11

If you're trying to plumb a NIC with a VLAN tag in Solaris 11, its not straight forward anymore!

First, Look for the interfaces that you have.


root@solaris:~# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net1              Ethernet             unknown    0      unknown   igb1
net3              Ethernet             unknown    10000  half      qlge3
net5              Ethernet             unknown    10000  half      qlge2
net0              Ethernet             unknown    0      unknown   igb0
net2              Ethernet             unknown    10000  full      qlge0
net9              Ethernet             unknown    10000  half      qlge1



This is a brand new install and T4 blade with the QLogic 10Gb CNA cards.  I had to figure out manually which one of these were connected to what.  

However, first things first.  To use a Tagged VLAN for the network interface, first use dladm create-vlan to create a new network interface.


root@solaris:~#  dladm create-vlan -l net2 -v 11
root@solaris:~# dladm show-link
LINK                CLASS     MTU    STATE    OVER
net1                phys      1500   unknown  --
net3                phys      1500   unknown  --
net5                phys      1500   unknown  --
net0                phys      1500   up       --
net2                phys      1500   up       --
net9                phys      1500   up       --
net11002            vlan      1500   up       net2

 Next plumb the interface


root@solaris:~#  ifconfig net11002 plumb  netmask 255.255.255.0 broadcast + up

You should now be able to SSH to the IP (if the default gateway is set right).  Run netstat -rn to see the default gateway.  If it's not set - "route add default " will do the trick.

If it is the wrong port, then you can just as easily run


root@solaris:~# dladm delete-vlan net11002

This will remove the new interface.





No comments: