static route 설정을 통해 PING 테스트
1) PC1 - R1 - R2 - R4 - PC2 <주경로>
1) PC1 - R1 - R3 - R4 - PC2 <보조경로>
R1
R1#conf t
R1(config)#int g0/0
R1(config-if)#ip addr 192.168.13.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int g1/0
R1(config-if)#ip addr 192.168.12.1 255.255.255.0
R1(config-if)#no sh
R1(config)#int g2/0
R1(config-if)#ip addr 192.168.1.254 255.255.255.0
R1(config-if)#no sh
R1(config)#ip route 192.168.4.0 255.255.255.0 192.168.12.2 10
R1(config)#ip route 192.168.4.0 255.255.255.0 192.168.13.3 20
R2
R2#conf t
R2(config)#int g1/0
R2(config-if)#ip addr 192.168.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int g2/0
R2(config-if)#ip addr 192.168.24.2 255.255.255.0
R2(config-if)#no sh
R2(config)#ip route 192.168.4.0 255.255.255.0 192.168.24.4
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.12.1
R3
R3#conf t
R3(config)#int g0/0
R3(config-if)#ip addr 192.168.13.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int g1/0
R3(config-if)#ip addr 192.168.34.3 255.255.255.0
R3(config-if)#no sh
R3(config)#ip route 192.168.4.0 255.255.255.0 192.168.34.4
R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.13.1
R4
R4#conf t
R4(config)#int g1/0
R4(config-if)#ip addr 192.168.34.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#int g2/0
R4(config-if)#ip addr 192.168.24.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#int g0/0
R4(config-if)#ip addr 192.168.4.254 255.255.255.0
R4(config-if)#no sh
R4(config)#ip route 192.168.1.0 255.255.255.0 192.168.24.2 10
R4(config)#ip route 192.168.1.0 255.255.255.0 192.168.34.3 20
PC1
PC1> ip 192.168.1.1 255.255.255.0 192.168.1.254
PC2
PC2> ip 192.168.4.1 255.255.255.0 192.168.4.254
3)Default Route 설정으로 외부 경로 추가, NAT 설정 등 필요 (PC1, PC2>ping 8.8.8.8)
R1
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2
R2
R2(config)#int g0/0
R2(config-if)#ip addr dhcp
R2(config-if)#no sh
R2(config-if)#ip nat outside
R2(config-if)#int g2/0
R2(config-if)#ip nat inside
R2(config-if)#int g1/0
R2(config-if)#ip nat inside
R2(config)#ip nat inside source list 1 interface g0/0
R2(config)#access-list 1 permit any
R4
R4(config)#ip route 0.0.0.0 0.0.0.0 192.168.24.2
NOTE
ip route 0.0.0.0 0.0.0.0 192.168.12.2 (next hop) / metric 값이 1
ip route 0.0.0.0 0.0.0.0 g1/0(자기 자신의 출구 인터페이스) / metric 값이 0 = 우선 순위가 더 높음
ip route 0.0.0.0 0.0.0.0 g1/0 192.168.12.2 / metric 값이 1
R1
R1>en
R1#conf t
R1(config)#int g0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no sh
R1(config)#int g0/1
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#no sh
R1(config)# ip route 192.168.4.0 255.255.255.0 192.168.2.2
R1(config)# ip name-server 192.168.4.2
R2
R2>en
R2#conf t
R2(config)#int g0/1
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#no sh
R2(config)#int g0/2
R2(config-if)#ip address 192.168.3.2 255.255.255.0
R2(config-if)#no sh
R2(config)# ip route 192.168.4.0 255.255.255.0 192.168.3.1
R2(config)# ip route 192.168.1.0 255.255.255.0 192.168.2.1
R2(config)#ip name-server 192.168.4.2
R3
R3>en
R3#conf t
R3(config)#int g0/2
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no sh
R3(config)#int g0/0
R3(config-if)#ip address 192.168.4.1 255.255.255.0
R3(config-if)#no sh
R3(config)# ip route 192.168.1.0 255.255.255.0 192.168.3.2
R3(config)# ip route 192.168.2.0 255.255.255.0 192.168.3.2
R3(config)#ip name-server 192.168.4.2
S1
S1>en
S1#conf t
S1(config)#int vlan1
S1(config-if)#ip addr 192.168.1.5 255.255.255.0
S1(config-if)#no sh
S1(config)#ip name-server 192.168.4.2
S1(config)#ip default-gateway 192.168.1.254
S2
S2>en
S2#conf t
S2(config)#int vlan1
S2(config-if)#ip addr 192.168.4.5 255.255.255.0
S2(config-if)#no sh
S2(config)#ip name-server 192.168.4.2
S2(config)#ip default-gateway 192.168.4.1
PC1
PC2
DNS server
cisco.com
google.com
결과
'네트워크 > lab' 카테고리의 다른 글
[240416] (0) | 2024.04.16 |
---|---|
[240409] (0) | 2024.04.09 |
IPv4, IPv6 (0) | 2024.04.05 |
GNS 연결, access-list, Network-Automation (0) | 2024.04.05 |
DHCP&DNS (0) | 2024.04.04 |