Sunday, 21 October 2018

Solaris 11 : How to configure VLAN tagging on a network interface By Devan

Solaris 11 : How to configure VLAN tagging on a network interface

A virtual local area network (VLAN) are basically used to isolate groups of users from each other for ease of network administration and security. In Solaris 11, VLANs are created using dladm and the IP address is assigned using ipadm. The post describes configuration of VLAN tagging on network interface with an example.

Configuration

To list out the physical network interfaces on the system use:
# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      e1000g0
Verify the VLANs configured on the system with :
# dladm show-vlan
Now create VLAN tag 789 on interface net0 :
# dladm create-vlan -l net0 -v 789

Verify

Check the configured VLAN
# dladm show-vlan
LINK                VID      OVER                FLAGS
net789000           789      net0                -----

Configuring IP address

We can now configure an IP address on this new VLAN we just created. The newly created will VLAN as a new interface will show up in the command “dladm show-link”.
# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      e1000g0
# dladm show-link
LINK                CLASS     MTU    STATE    OVER
net0                phys      1500   up       --
net789000           vlan      1500   up       net0
Configure an IP adresss using this new interface net789000.
# ipadm create-ip net789000
# ipadm create-addr -T static -a 192.168.1.45/24 net789000/v4
# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4           static   ok           192.168.1.45/24
net789000/v4      static   ok           192.168.1.45/24
lo0/v6            static   ok           ::1/128
net0/v6           addrconf ok           fe80::20c:29ff:fe64:7351/10
Another method to create a vlan tagged interface is to create a vnic and specifiy the vlan id :-
# dladm create-vnic -l net0 -v 768 vnic768
# dladm show-vnic
LINK                OVER              SPEED  MACADDRESS        MACADDRTYPE VIDS
vnic768             net0              1000   2:8:20:f:b8:6b    random      768
NOTE : dladm show-vlan will only show you the vlan objects you create with dladm create-vlan and since the object above is a vnic object that has a vlan tag id you will need to use dladm show-vnic to see the vnic object. Notice that a vnic object as has a valid vid also.

No comments:

Post a Comment