Membuat VLAN tagging di interface virbr1 dengan nama dan ID VLAN 100
ip link add link virbr1 name virbr1.100 type vlan id 100 ip link set dev virbr1.100 up
Verifikasi
ip -d link show virbr1.100 10: virbr1.100@virbr1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:50:86:8d brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1Q id 100 addrgenmode eui64
Menambahkan IP ke interface VLAN
ip add add 10.10.100.1/24 dev virbr1.100
Verifikasi
ip -d a show virbr1.100 10: virbr1.100@virbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 52:54:00:50:86:8d brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1Q id 100 inet 10.10.100.1/24 scope global virbr1.100 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe50:868d/64 scope link valid_lft forever preferred_lft forever
Hapus VLAN
ip link delete virbr1.100
Catatan: VLAN yang dibuat dengan ip command akan hilang jika sistem shutdown atau restart, jika ingin membuatnya permanen gunakan ifcfg files
Refrensi: 7.4. Configure 802.1Q VLAN Tagging Using the Command Line
Comments