VLAN(Virtual LAN) L2 스위치부터 제공되는 가상의 LAN을 구성하는 기능이다. 논리적인 네트워크 분리기술로 식별자(number)를 이용한 network 이름을 지정한다는 특징이 있다. (VLAN 10) VLAN 사용 목적 - 네트워크(Broadcast Domain) 분리 - 보안 - 유연성 1개의 스위치에 VLAN 연결하기-
vlan 생성 후 확인 Switch(config)#vlan 10 - 인터페이스 별 VLAN 설정 Switch(config)#int f0/1 Switch(config-if)#int f0/3 Switch(config-if)#int f0/2 Switch(config-if)#int f0/4 Switch#sh vlan brief 로 확인 ※ VLAN을 1개만 연결(ACCESS) / 여러개 연결(TRUNK)
2개의 스위치에 VLAN 연결하기(앞에 실습에서 추가 !) 두번 째 스위치에 VLAN 생성 Switch2(config)#vlan 10
Switch2(config)#int f0/1 Switch2(config-if)#int f0/2 Switch#sh vlan brief 로 확인 vlan 1에만 연결되어 있는 것을 확인할 수 있다 (=> 통신 XXX) 케이블을 추가하여 각각 VLAN 10, 20을 정한다각 스위치 연결 포트에 VLAN 설정 Switch0(config)#int f0/23 Switch2(config-if)#int f0/23 !!!!!!문제점 포트의 낭비 + 복잡!!!!!!! ==> vlan 개수가 늘어나면 access 포트 연결도 늘어난다 !!!!!!!!!!! 여러개의 VLAN을 연결하기 위한 TRUNK 방식 인터페이스에 VLAN설정 (트렁킹) Switch0(config)#int f0/20 -- 포트 트렁킹 확인 switch2#sh interfaces trunk native vlan - trunk에서 tagging 하지 않는 vlan Switch0(config)#vlan 77 Switch0(config)#int f0/20 Switch0(config-if)#switchport trunk ? Switch0(config-if)#switchport trunk native vlan 77 Switch2(config)#int f0/20 f0/10을 native vlan용으로 지정 (양쪽 스위칭) pc 추가 후 연결 Switch0(config)#int f0/20 Switch2(config)#int f0/20 DynamicTrunkingProtocol 양쪽 스위치간 negotiation을 통해 동적으로 결정하는 방식 InterVLAN : ROUTER라우팅을 통해 VLAN10과 VLAN20끼리 통신 Router(config)#int f0/0 Router(config-if)#no shutdown -- sub interface = 논리적인 인터페이스 Router(config-subif)#int f0/0.10 Router(config-if)#int f0/0.10 Router(config-subif)#encapsulation dot1Q 10 Router(config-subif)#ip address 192.168.100.254 255.255.255.0 Router(config-subif)#int f0/0.20 Router(config-subif)#encapsulation dot1Q 20 Router(config-subif)#ip address 192.168.200.254 255.255.255.0 switch0(config-if)#int f0/19 switch0(config-if)#switchport mode trunk switch0(config-if)#switchport trunk allowed vlan 10,20 Router(config-subif)#do sh ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES unset up up FastEthernet0/0.10 192.168.241.254 YES manual up up FastEthernet0/0.20 unassigned YES unset up up vlan 20인 경우 TTL=127인 것을 확인 이유는 라우터를 통해서 들어왔기 때문 vlan 생성 인터페이스 별 vlan 설정 L2 가상 인터페이스 생성 L2 trunk 설정 L3는 dynamic auto로 trunk 형성 L3 vlan 생성 후 SVI 설정
L3 라우팅 기능 활성화 심화 정리 ens32 인터페이스를 제외한 모든 네트워크는 출발지 주소변환 대상 - 출발지 주소 변환을 지정 [root@localhost ~]# route g/w 삭제 [root@localhost ~]# route
[root@localhost ~]# ip route 0.0.0.0 0.0.0.0 200.200.200.254 디폴트라우트 설정 [root@localhost ~]# ping 8.8.8.8 [root@localhost ~]# route add default netmask 0.0.0.0 gw 200.200.200.254 iptables- F (=iptables -t filter -F) SNAT (sourceNAT in->out) => normalNAT DNAT(DestinationNAT out->in) => reverseNAT # iptables -t nat -L Chain INPUT (policy ACCEPT) Chain OUTPUT (policy ACCEPT) Chain POSTROUTING (policy ACCEPT) |