CCNA R&S (CCNA5.0) Cấu hình Cơ bản và định tuyến IPv4, IPv6 trong bài lab openlab1-s2new (phần 2)
Cấu hình Gate1
ena
conf t
hos GATE1
enable secret cisco@sec
line con 0
pass cisco@sec
login
exit
access-list 10 permit 172.16.1.0 0.0.0.255
line vty 0 4
access-class 10 in
password cisco@telnet
login
exit
ipv6 unicast-routing
interface GigabitEthernet0/0
ip address 200.2.2.1 255.255.255.252
ipv6 address 2001:1::1/64
no shut
interface GigabitEthernet0/1
ip address 192.168.123.1 255.255.255.0
no shut
interface GigabitEthernet0/2
ip address 192.168.33.1 255.255.255.0
ipv6 address 2003:3::1/64
no shut
interface Serial0/0/0
ip address 172.16.14.1 255.255.255.0
no shut
cloc rate 56000
exit
ip route 0.0.0.0 0.0.0.0 200.2.2.2
ipv6 route ::/0 2001:1::2
router ospf 1
router-id 1.1.1.1
network 192.168.123.0 0.0.0.255 area 0
network 172.16.14.0 0.0.0.255 area 1
default-information originate
exit
exit
wr
copy vào cli
Router>
Router>ena
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hos GATE1
GATE1(config)#enable secret cisco@sec
GATE1(config)#line con 0
GATE1(config-line)#pass cisco@sec
GATE1(config-line)#login
GATE1(config-line)#exit
GATE1(config)#access-list 10 permit 172.16.1.0 0.0.0.255
GATE1(config)#line vty 0 4
GATE1(config-line)#access-class 10 in
GATE1(config-line)#password cisco@telnet
GATE1(config-line)#login
GATE1(config-line)#exit
GATE1(config)#ipv6 unicast-routing
GATE1(config)#interface GigabitEthernet0/0
GATE1(config-if)#ip address 200.2.2.1 255.255.255.252
GATE1(config-if)#ipv6 address 2001:1::1/64
GATE1(config-if)#no shut
GATE1(config-if)#interface GigabitEthernet0/1
GATE1(config-if)#ip address 192.168.123.1 255.255.255.0
GATE1(config-if)#no shut
GATE1(config-if)#interface GigabitEthernet0/2
GATE1(config-if)#ip address 192.168.33.1 255.255.255.0
GATE1(config-if)#ipv6 address 2003:3::1/64
GATE1(config-if)#no shut
GATE1(config-if)#interface Serial0/0/0
GATE1(config-if)#ip address 172.16.14.1 255.255.255.0
GATE1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
GATE1(config-if)#cloc rate 56000
GATE1(config-if)#exit
GATE1(config)#ip route 0.0.0.0 0.0.0.0 200.2.2.2
GATE1(config)#ipv6 route ::/0 2001:1::2
GATE1(config)#router ospf 1
GATE1(config-router)#router-id 1.1.1.1
GATE1(config-router)#network 192.168.123.0 0.0.0.255 area 0
GATE1(config-router)#network 172.16.14.0 0.0.0.255 area 1
GATE1(config-router)#default-information originate
GATE1(config-router)#exit
GATE1(config)#exit
GATE1#wr
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Cấu hình Gate4
ena
conf t
hos GATE4
enable secret cisco@sec
line con 0
pass cisco@sec
login
exit
access-list 10 permit 172.16.1.0 0.0.0.255
line vty 0 4
access-class 10 in
password cisco@telnet
login
exit
interface GigabitEthernet0/0
ip address 172.16.1.4 255.255.255.0
no shut
interface Serial0/0/0
ip address 172.16.14.4 255.255.255.0
no shut
exit
router ospf 1
router-id 4.4.4.4
network 172.16.1.0 0.0.0.255 area 1
network 172.16.14.0 0.0.0.255 area 1
exit
exit
wr
Router>
Router>
Router>ena
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hos GATE4
GATE4(config)#enable secret cisco@sec
GATE4(config)#line con 0
GATE4(config-line)#pass cisco@sec
GATE4(config-line)#login
GATE4(config-line)#exit
GATE4(config)#access-list 10 permit 172.16.1.0 0.0.0.255
GATE4(config)#line vty 0 4
GATE4(config-line)#access-class 10 in
GATE4(config-line)#password cisco@telnet
GATE4(config-line)#login
GATE4(config-line)#exit
GATE4(config)#interface GigabitEthernet0/0
GATE4(config-if)#ip address 172.16.1.4 255.255.255.0
GATE4(config-if)#no shut
GATE4(config-if)#interface Serial0/0/0
GATE4(config-if)#ip address 172.16.14.4 255.255.255.0
GATE4(config-if)#no shut
GATE4(config-if)#exit
GATE4(config)#router ospf 1
GATE4(config-router)#router-id 4.4.4.4
GATE4(config-router)#network 172.16.1.0 0.0.0.255 area 1
GATE4(config-router)#network 172.16.14.0 0.0.0.255 area 1
GATE4(config-router)#exit
GATE4(config)#exit
GATE4#wr
GATE4#
GATE4#show ip route
Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level-2, ia – IS-IS inter area
* – candidate default, U – per-user static route, o – ODR
P – periodic downloaded static route
Gateway of last resort is 172.16.14.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 3 subnets
O E2 10.1.1.0/24 [[]110/100] via 172.16.14.1, 00:00:51, Serial0/0/0
O E2 10.1.12.0/24 [[]110/100] via 172.16.14.1, 00:00:51, Serial0/0/0
O E1 10.2.23.0/24 [[]110/265] via 172.16.14.1, 00:00:51, Serial0/0/0
172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet0/0
L 172.16.1.4/32 is directly connected, GigabitEthernet0/0
C 172.16.14.0/24 is directly connected, Serial0/0/0
L 172.16.14.4/32 is directly connected, Serial0/0/0
O IA 192.168.123.0/24 [[]110/65] via 172.16.14.1, 00:00:51, Serial0/0/0
O*E2 0.0.0.0/0 [[]110/1] via 172.16.14.1, 00:00:51, Serial0/0/0
GATE4#
Nguồn: Trung tâm thiết bị viễn thông bách khoa