In order to arrange vlan interfaces in Linux, some distros (base CentOS) need the vconfig utility:
Adding vlan interface in Linux:
To verify the eth1.10 vlan interface (tag 10), I'll do a ping in the 192.168.10.0/24 subnet and a tcpdump on the other window on the physical interface:
Removing vlan interface in Linux:
Code:
# rpm -qa | grep vconfig
vconfig-1.9-3
vconfig-1.9-3
Adding vlan interface in Linux:
Code:
# vconfig add eth1 10
Added VLAN with VID == 10 to IF -:eth1:-
# ip a l eth1.10
14: eth1.10@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop
link/ether 00:0c:29:5a:13:77 brd ff:ff:ff:ff:ff:ff
Added VLAN with VID == 10 to IF -:eth1:-
# ip a l eth1.10
14: eth1.10@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop
link/ether 00:0c:29:5a:13:77 brd ff:ff:ff:ff:ff:ff
Code:
# ip a add 192.168.10.2/24 dev eth1.10
# ifconfig eth1.10 up
## ip a l eth1.10
14: eth1.10@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
link/ether 00:0c:29:5a:13:77 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.2/24 scope global eth1.10
inet6 fe80::20c:29ff:fe5a:1377/64 scope link
valid_lft forever preferred_lft forever
# ifconfig eth1.10 up
## ip a l eth1.10
14: eth1.10@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
link/ether 00:0c:29:5a:13:77 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.2/24 scope global eth1.10
inet6 fe80::20c:29ff:fe5a:1377/64 scope link
valid_lft forever preferred_lft forever
To verify the eth1.10 vlan interface (tag 10), I'll do a ping in the 192.168.10.0/24 subnet and a tcpdump on the other window on the physical interface:
Code:
# ping 192.168.10.10
PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.
From 192.168.10.2 icmp_seq=2 Destination Host Unreachable
From 192.168.10.2 icmp_seq=3 Destination Host Unreachable
# tcpdump -nni eth1 -e vlan
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
14:23:26.335853 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
14:23:27.350607 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
14:23:28.361366 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.
From 192.168.10.2 icmp_seq=2 Destination Host Unreachable
From 192.168.10.2 icmp_seq=3 Destination Host Unreachable
# tcpdump -nni eth1 -e vlan
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
14:23:26.335853 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
14:23:27.350607 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
14:23:28.361366 00:0c:29:5a:13:77 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, arp who-has 192.168.10.10 tell 192.168.10.2
Removing vlan interface in Linux:
Code:
# vconfig rem eth1.10
Removed VLAN -:eth1.10:-
# ip a l eth1.10
Device "eth1.10" does not exist.
Removed VLAN -:eth1.10:-
# ip a l eth1.10
Device "eth1.10" does not exist.
_________________
Andrei Manescu - andrei.manescu _at_ ivorde.ro
출처 : http://forum.ivorde.ro/linux-adding-and-removing-vlan-tagged-interfaces-t15231.html
'Skills > RedHat, CentOS' 카테고리의 다른 글
Error restarting the network service (0) | 2014.08.06 |
---|---|
9.2.6. Setting Up 802.1q VLAN Tagging (0) | 2014.07.31 |
Configuring VLANs Under Fedora/RHEL/CentOS. (0) | 2014.07.31 |
CentOS 화면 보호기 끄기 (0) | 2014.07.24 |
Disable Network Manager Service in CENTOS 6 (0) | 2014.07.14 |
댓글