一、拓展及要求
二、过程
1、先配置设备的IP地址(PC1-PC4已配置)
(1)R1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Jul 8 2024 12:11:20-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]int s 4/0/0
[R1-Serial4/0/0]ip address 15.0.0.1 8
[R1-Serial4/0/0]
(2)R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
Jul 8 2024 12:19:38-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]int s 4/0/0
[R2-Serial4/0/0]ip address 25.0.0.1 8
[R2-Serial4/0/0]
(3)R3
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
Jul 8 2024 12:22:21-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]int s 4/0/0
[R3-Serial4/0/0]ip address 35.0.0.1 8
[R3-Serial4/0/0]
(4)R4
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.4.1 24
[R4-GigabitEthernet0/0/0]
Jul 8 2024 12:25:02-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 add
[R4-GigabitEthernet0/0/1]ip address 45.0.0.1 8
Jul 8 2024 12:26:39-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]
(5)R5
[ISP]int s 3/0/0
[ISP-Serial3/0/0]int s 3/0/1
[ISP-Serial3/0/1]ip address 25.0.0.5 8
[ISP-Serial3/0/1]
[ISP-Serial3/0/1]int s 3/0/0
[ISP-Serial3/0/0]ip address 15.0.0.5 8
[ISP-Serial3/0/0]
[ISP-Serial3/0/0]int s 4/0/0
[ISP-Serial4/0/0]ip add 35.0.0.5 8
[ISP-Serial4/0/0]
[ISP-Serial4/0/0]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip add 45.0.0.5 8
[ISP-GigabitEthernet0/0/0]
[ISP-GigabitEthernet0/0/0]int LoopBack 0
[ISP-LoopBack0]ip address 5.5.5.5 8
[ISP-LoopBack0]
2、配置缺省路由
(一)R5为ISP,只能进行Ip地址配置;其所有地址均为公有IP地址
(二)PPP、PAP、CHAP、HDLC
1、R1和R5间使用PPP的PAP认证,R5为主认证方;
(1)R1
[R1]aaa
[R1-aaa]lo
[R1-aaa]local-user cy1 p
[R1-aaa]local-user cy1 pri
[R1-aaa]local-user cy1 privilege level 15 pa
[R1-aaa]local-user cy1 privilege level 15 password ciph
[R1-aaa]local-user cy1 privilege level 15 password cipher 54321
Info: Add a new user.
[R1-aaa]
(2)R5
[ISP]aaa
[ISP-aaa]lo
[ISP-aaa]local-user cy1 pa
[ISP-aaa]local-user cy1 password ci
[ISP-aaa]local-user cy1 password cipher 12345
Info: Add a new user.
[ISP-aaa]int s 3/0/0
[ISP-Serial3/0/0]ppp auth
[ISP-Serial3/0/0]ppp authentication-mode pap
[ISP-Serial3/0/0]
2、R2与R5之间使用PPPp的chap认证,R5为主认证方;
(1)R2
<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]int s 4/0/0
[R2-Serial4/0/0]ppp chap pass
[R2-Serial4/0/0]ppp chap password cipher 54321
[R2-Serial4/0/0]
(2)R5
<ISP>sys
Enter system view, return user view with Ctrl+Z.
[ISP]int
[ISP]interface s 3/0/1
[ISP-Serial3/0/1]ppp auth
[ISP-Serial3/0/1]ppp authentication-mode chap
[ISP-Serial3/0/1]
3、R3与R5之间使用HDLC封装。
(1)R3
<R3>sy
Enter system view, return user view with Ctrl+Z.
[R3]int s 4/0/0
[R3-Serial4/0/0]link-
[R3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Jul 8 2024 13:08:44-08:00 R3 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed
the configuration that will change the encapsulation protocol of the link and th
en selected Y.
[R3-Serial4/0/0]
(2)R5
[ISP-Serial3/0/1]int s 4/0/0
[ISP-Serial4/0/0]link-
[ISP-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Jul 8 2024 13:11:26-08:00 ISP %%01IFNET/4/CHANGE_ENCAP(l)[2]:The user performed
the configuration that will change the encapsulation protocol of the link and t
hen selected Y.
[ISP-Serial4/0/0]
(三)构建MGRE、GRE
1、R1/R2/R3构建一个MGRE环境,R1为中心站点;
(1)R1
<R1>sy
Enter system view, return user view with Ctrl+Z.
[R1]int t 0/0/0
[R1-Tunnel0/0/0]ip address 192.168.5.1 24
[R1-Tunnel0/0/0]tunn
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]sou
[R1-Tunnel0/0/0]source 15.0.0.1
Jul 8 2024 13:17:02-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]
[R1-Tunnel0/0/0]
[R1-Tunnel0/0/0]nhrp net
[R1-Tunnel0/0/0]nhrp network-id 50
[R1-Tunnel0/0/0]
(2)R2
[R2]int t 0/0/0
[R2-Tunnel0/0/0]ip add
[R2-Tunnel0/0/0]ip address 192.168.5.2 24
[R2-Tunnel0/0/0]tunnel
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]sou
[R2-Tunnel0/0/0]source sr
[R2-Tunnel0/0/0]source ser
[R2-Tunnel0/0/0]source Serial 4/0/0
Jul 8 2024 13:18:59-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 ent
[R2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 re
[R2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[R2-Tunnel0/0/0]
(3)R3
[R3]int t 0/0/0
[R3-Tunnel0/0/0]ip add 192.168.5.3 24
[R3-Tunnel0/0/0]tunn
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]so
[R3-Tunnel0/0/0]source s 4/0/0
Jul 8 2024 13:21:55-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]nhrp net
[R3-Tunnel0/0/0]nhrp network-id 50
[R3-Tunnel0/0/0]nhrp en
[R3-Tunnel0/0/0]nhrp entry
^
Error:Incomplete command found at '^' position.
[R3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 re
[R3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[R3-Tunnel0/0/0]
2、R1、R4间为点到点的GRE。
(1)R1
<R1>sy
Enter system view, return user view with Ctrl+Z.
[R1]int t 0/0/1
[R1-Tunnel0/0/1]ip add 192.168.6.1 24
[R1-Tunnel0/0/1]tunn
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]sou
[R1-Tunnel0/0/1]source 15.0.0.1
[R1-Tunnel0/0/1]des
[R1-Tunnel0/0/1]description 45.0.0.1
[R1-Tunnel0/0/1]
(2)R4
[R4]int t 0/0/0
[R4-Tunnel0/0/0]ip add 192.168.6.2 24
[R4-Tunnel0/0/0]tunn
[R4-Tunnel0/0/0]tunnel-protocol g
[R4-Tunnel0/0/0]tunnel-protocol gre
[R4-Tunnel0/0/0]so
[R4-Tunnel0/0/0]source 45.0.0.1
[R4-Tunnel0/0/0]des
^
Error:Ambiguous command found at '^' position.
[R4-Tunnel0/0/0]des
[R4-Tunnel0/0/0]description 15.0.0.1
[R4-Tunnel0/0/0]
(四)整个私有网络基于RIP全网可达
(1)R1
[R1]rip 1
[R1-rip-1]ver
[R1-rip-1]version 2
[R1-rip-1]net
[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]
(2)R2
[R2]rip 1
[R2-rip-1]ver
[R2-rip-1]vers
[R2-rip-1]version 2
[R2-rip-1]net
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 192.168.5.0
[R2-rip-1]
(3)R3
[R3]rip 1
[R3-rip-1]vers
[R3-rip-1]version 2
[R3-rip-1]net
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 192.168.5.0
[R3-rip-1]
(4)R4
[R4]rip 1
[R4-rip-1]vers
[R4-rip-1]version 2
[R4-rip-1]net
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 192.168.5.0
[R4-rip-1]network 192.168.6.0
[R4-rip-1]
(5)添加缺省
[R4-rip-1]int t 0/0/1
[R4-Tunnel0/0/1]ip route-static 0.0.0.0 0 45.0.0.5
Error: The route already exists.
ping 15.0.0.1
(五)所有Pc设置私有IP为源IP,可以访问R5环回
(1)R1
[R1]acl 2000
[R1-acl-basic-2000]rule per
[R1-acl-basic-2000]rule permit s
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R1-acl-basic-2000]int s 4/0/0
[R1-Serial4/0/0]nat out
[R1-Serial4/0/0]nat outbound 2000
[R1-Serial4/0/0]
[R1-Serial4/0/0]
ping 5.5.5.5
(2)R2
[R2]acl 2000
[R2-acl-basic-2000]rule pe
[R2-acl-basic-2000]rule permit so
[R2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[R2-acl-basic-2000]int s 4/0/0
[R2-Serial4/0/0]net ou
[R2-Serial4/0/0]net ou
[R2-Serial4/0/0]net out
[R2-Serial4/0/0]nat ou
[R2-Serial4/0/0]nat outbound 2000
[R2-Serial4/0/0]
(3)R3
[R3]acl 2000
[R3-acl-basic-2000]rule pe
[R3-acl-basic-2000]rule permit so
[R3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[R3-acl-basic-2000]int s 4/0/0
[R3-Serial4/0/0]nat ou
[R3-Serial4/0/0]nat outbound 2000
[R3-Serial4/0/0]
(4)R4
[R4]acl 2000
[R4-acl-basic-2000]rule pe
[R4-acl-basic-2000]rule permit so
[R4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[R4-acl-basic-2000]int g 0/0/1
[R4-GigabitEthernet0/0/1]nat ou
[R4-GigabitEthernet0/0/1]nat outbound 2000
[R4-GigabitEthernet0/0/1]