Minggu, 22 Januari 2017

VLAN Centos7

Configuring 802.1q VLAN in CentOS 7

The fastest way to enable 802.1q VLAN tagging on CentOS is by using the previously-mentioned nmtui, on the 'Edit interfaces' screen. Click on 'Add', scroll down to VLAN and then on 'Create'. Obviously, you need to know the name of the physical interface where this VLAN will be enabled. I chose the name 'inside-vlan10' for my profile, using VLAN id 10. The name of the virtual interface is 'vlan10', going on the physical device ens34



After configuring the interface, it can be brought up with ifup:

[root@localhost network-scripts]# ifup vlan10
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
[root@localhost network-scripts]# ip link show dev vlan10
6: vlan10@ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT 
    link/ether 00:0c:29:6e:83:e5 brd ff:ff:ff:ff:ff:ff


Below is the contents of the file created by nmtui-edit: ifcfg-inside-vlan10:

[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-inside-vlan10 
VLAN=yes
TYPE=Vlan
DEVICE=vlan10
PHYSDEV=ens34
VLAN_ID=10
REORDER_HDR=0
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=inside-vlan10
UUID=6c1d0445-a440-4755-97df-c8c071458e5b
ONBOOT=yes

Tidak ada komentar:

Posting Komentar