配置IP地址
R1
[r1]int s 4/0/0
[r1-Serial4/0/0]ip address 15.0.0.1 24
[r1-Serial4/0/0]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Apr 14 2022 19:15:08-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]
R2
[r2]int s 4/0/0
[r2-Serial4/0/0]ip address 25.0.0.1 24
[r2-Serial4/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.2.1 24
[r2-GigabitEthernet0/0/1]
R3
[r3]int s 4/0/0
[r3-Serial4/0/0]ip address 35.0.0.1 24
[r3-Serial4/0/0]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
Apr 14 2022 19:18:16-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]
R4
[r4] int g 0/0/0
[r4-GigabitEthernet0/0/0]ip address 45.0.0.1 24
[r4-GigabitEthernet0/0/0]
Apr 14 2022 19:19:03-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
Apr 14 2022 19:19:24-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r4-GigabitEthernet0/0/1]
R5
[isp]int s 3/0/0
[isp-Serial3/0/0]ip address 15.0.0.2 24
[isp-Serial3/0/0]
Apr 14 2022 19:22:02-08:00 isp %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PP
P IPCP on the interface Serial3/0/0 has entered the UP state.
[isp-Serial3/0/0]int s 3/0/1
[isp-Serial3/0/1]ip address 25.0.0.2 24
[isp-Serial3/0/1]
Apr 14 2022 19:22:23-08:00 isp %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PP
P IPCP on the interface Serial3/0/1 has entered the UP state.
[isp-Serial3/0/1]int s 4/0/0
[isp-Serial4/0/0]ip address 35.0.0.2 24
[isp-Serial4/0/0]
Apr 14 2022 19:22:39-08:00 isp %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PP
P IPCP on the interface Serial4/0/0 has entered the UP state.
[isp-Serial4/0/0]int g 0/0/0
[isp-GigabitEthernet0/0/0]ip address 45.0.0.2 24
Apr 14 2022 19:22:52-08:00 isp %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[isp-GigabitEthernet0/0/0]int l0
[isp-LoopBack0]ip address 5.5.5.5 24
缺省路由
R1
[r1]ip route-static 0.0.0.0 0 15.0.0.2
R2
[r2]ip route-static 0.0.0.0 0 25.0.0.2
R3
[r3]ip route-static 0.0.0.0 0 35.0.0.2
R4
[r4]ip route-static 0.0.0.0 0 45.0.0.2
R1 R5 华为设备串线默认PPP封装
[r1]display interface Serial 4/0/0
Serial4/0/0 current state : UP
Line protocol current state : UP
Last line protocol up time : 2022-04-14 19:22:02 UTC-08:00
Description:HUAWEI, AR Series, Serial4/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)
Internet Address is 15.0.0.1/24
Link layer protocol is PPP
LCP opened, IPCP opened
Last physical up time : 2022-04-14 19:01:22 UTC-08:00
Last physical down time : 2022-04-14 19:01:14 UTC-08:00
Current system time: 2022-04-14 19:34:47-08:00
Physical layer is synchronous, Virtualbaudrate is 64000 bps
Interface is DTE, Cable type is V11, Clock mode is TC
Last 300 seconds input rate 11 bytes/sec 88 bits/sec 0 packets/sec
Last 300 seconds output rate 6 bytes/sec 48 bits/sec 0 packets/sec
Input: 437 packets, 15034 bytes
Broadcast: 0, Multicast: 0
Errors: 0, Runts: 0
Giants: 0, CRC: 0
Alignments: 0, Overruns: 0
Dribbles: 0, Aborts: 0
No Buffers: 0, Frame Error: 0
---- More ----
[isp]display interface Serial 3/0/0
Serial3/0/0 current state : UP
Line protocol current state : UP
Last line protocol up time : 2022-04-14 19:22:02 UTC-08:00
Description:HUAWEI, AR Series, Serial3/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)
Internet Address is 15.0.0.2/24
Link layer protocol is PPP
LCP opened, IPCP opened
Last physical up time : 2022-04-14 19:01:22 UTC-08:00
Last physical down time : 2022-04-14 19:01:18 UTC-08:00
Current system time: 2022-04-14 19:35:16-08:00
Physical layer is synchronous, Virtualbaudrate is 64000 bps
Interface is DTE, Cable type is V11, Clock mode is TC
Last 300 seconds input rate 11 bytes/sec 88 bits/sec 0 packets/sec
Last 300 seconds output rate 6 bytes/sec 48 bits/sec 0 packets/sec
Input: 443 packets, 15368 bytes
Broadcast: 0, Multicast: 0
Errors: 0, Runts: 0
Giants: 0, CRC: 0
Alignments: 0, Overruns: 0
Dribbles: 0, Aborts: 0
No Buffers: 0, Frame Error: 0
---- More ----
PAP认证
[isp]aaa
[isp-aaa]local-user admin ?
access-limit Set access limit of user(s)
ftp-directory Set user(s) FTP directory permitted
idle-timeout Set the timeout period for terminal user(s)
password Set password
privilege Set admin user(s) level
service-type Service types for authorized user(s)
state Activate/Block the user(s)
user-group User group
[isp-aaa]local-user admin password cipher 123456
[isp-aaa]local-user admin service-type ppp
开启PAP认证
[isp]int s 3/0/0
[isp-Serial3/0/0]ppp authentication-mode ?
chap Enable CHAP authentication
pap Enable PAP authentication
[isp-Serial3/0/0]ppp authentication-mode pap
R1提供认证信息
[r1]int s 4/0/0
[r1-Serial4/0/0]ppp pap ?
local-user Specify user name
[r1-Serial4/0/0]ppp pap local-user admin password ?
cipher Display the current password with cipher text
simple Display the current password with plain text
[r1-Serial4/0/0]ppp pap local-user admin password cipher 123456
[r1-Serial4/0/0]
CHAP认证
[isp]int s 3/0/1
[isp-Serial3/0/1]ppp authentication-mode chap
[isp-Serial3/0/1]
开启认证
[r2]int s 4/0/0
[r2-Serial4/0/0]ppp chap ?
password Specify user password
user Specify user name
[r2-Serial4/0/0]ppp chap user ?
STRING<1-64> User name
[r2-Serial4/0/0]ppp chap user admin
[r2-Serial4/0/0]ppp chap password cipher 123456
[r2-Serial4/0/0]
R3 R5使用HDLC封装
[r3]int s 4/0/0
[r3-Serial4/0/0]link-protocol ?
fr Select FR as line protocol
hdlc Enable HDLC protocol
lapb LAPB(X.25 level 2 protocol)
ppp Point-to-Point protocol
sdlc SDLC(Synchronous Data Line Control) protocol
x25 X.25 protocol
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[isp]int s 4/0/0
[isp-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
搭建MGRE环境
R1中心站点
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.5.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.0.0.1
Apr 14 2022 22:31:45-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r1-Tunnel0/0/0]nhrp network-id 100
开启中心站点伪广播
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
R2
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip address 192.168.5.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source Serial 4/0/0
Apr 14 2022 22:36:28-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
R3
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.5.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
Apr 14 2022 22:39:28-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r3-Tunnel0/0/0]
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
R1 R4为点到点的GRE
R1
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ip address 192.168.6.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.0.0.1
[r1-Tunnel0/0/1]destination 45.0.0.1
Apr 14 2022 22:42:49-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[r1-Tunnel0/0/1]
[r1-Tunnel0/0/1]
R4
[r4]int t 0/0/1
[r4-Tunnel0/0/1]ip address 192.168.6.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.0.0.1
[r4-Tunnel0/0/1]destination 15.0.0.1
Apr 14 2022 22:44:10-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[r4-Tunnel0/0/1]
[r4-Tunnel0/0/1]
基于RIP全网可达
R1
[r1]rip
[r1-rip-1]v
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.5.0
[r1-rip-1]network 192.168.6.0
[r1-rip-1]
R2
[r2]rip
[r2-rip-1]v 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
[r2-rip-1]
R3
[r3]rip
[r3-rip-1]v 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
[r3-rip-1]
R4
[r4]rip
[r4-rip-1]v 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.6.0
[r4-rip-1]network 192.168.5.0
[r4-rip-1]
关闭RIP水平分割
[r1]int t 0/0/0
[r1-Tunnel0/0/0]undo rip ?
authentication-mode Authentication type
bfd Bidirectional Forwarding Detection
input Enable/Disable receiving RIP packets
metricin Assign a metric to be added to the metric of inbound
route
metricout Assign a metric to be added to the outbound route
output Enable/Disable sending RIP packets
pkt-transmit The RIP inter-packet configurations
poison-reverse Configure poison reverse
replay-protect Configure replay-protect on interface
split-horizon Configure split horizon
summary-address Configure summary address on this interface
version Specify RIP version
[r1-Tunnel0/0/0]undo rip split-horizon
NAT
R1
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]int s 4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r1-Serial4/0/0]
R2
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]int s 4/0/0
[r2-Serial4/0/0]nat outbound 2000
R3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
Error: The rule already exists.
[r3-acl-basic-2000]q
[r3]int s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
R4
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]q
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000
[r4-GigabitEthernet0/0/0]