본문 바로가기

IT Tech/Linux

[LINUX] 리눅스 시스템에 VLAN 추가,삭제하기

반응형





1. eth1 에 vlan 100 인터페이스 추가하기
[root@localhost ~]# vconfig add eth1 100
Added VLAN with VID == 100 to IF -:eth1:-
[root@localhost ~]# ifconfig eth1.100 100.1.1.1
[root@localhost ~]# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:0C:29:AF:F2:7D 
          inet addr:10.1.3.1  Bcast:10.1.3.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feaf:f27d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8281 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:10796549 (10.2 MiB)
          Interrupt:59 Base address:0x20a4

eth1.100  Link encap:Ethernet  HWaddr 00:0C:29:AF:F2:7D 
          inet addr:100.1.1.1  Bcast:100.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::20c:29ff:feaf:f27d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:1782 (1.7 KiB)



2. vlan 삭제하기
[root@localhost ~]# vconfig rem eth1.100
Removed VLAN -:eth1.100:-
[root@localhost ~]# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:0C:29:AF:F2:7D 
          inet addr:10.1.3.1  Bcast:10.1.3.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feaf:f27d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8320 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:10803236 (10.3 MiB)
          Interrupt:59 Base address:0x20a4












반응형