实验要求:
实现过程:
(一)配置IP地址:
AR1:
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip add 200.1.1.1 24
Apr 3 2024 19:25:38-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[AR1-GigabitEthernet0/0/0]q
[AR1]int g 0/0/1
[AR1-GigabitEthernet0/0/1]ip add 10.1.1.1 24
Apr 3 2024 19:26:04-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[AR1-GigabitEthernet0/0/1]q
[AR1]int g0/0/2
[AR1-GigabitEthernet0/0/2]ip add 10.2.2.1 24
Apr 3 2024 19:26:27-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[AR1-GigabitEthernet0/0/2]q
[AR1]
[AR1]int l0
[AR1-LoopBack0]ip add 1.1.1.1 32
[AR1-LoopBack0]q
AR2:
[AR2]int g 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
Apr 3 2024 19:27:00-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[AR2-GigabitEthernet0/0/0]q
[AR2]int g 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 10.3.3.2 24
Apr 3 2024 19:27:26-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[AR2-GigabitEthernet0/0/1]q
[AR2]int l0
[AR2-LoopBack0]ip add 2.2.2.2 32
[AR2-LoopBack0]q
AR3:
[AR3]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip add 10.2.2.3 24
Apr 3 2024 19:28:07-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[AR3-GigabitEthernet0/0/0]q
[AR3]int g 0/0/1
[AR3-GigabitEthernet0/0/1]ip add 10.3.3.3 24
Apr 3 2024 19:28:29-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[AR3-GigabitEthernet0/0/1]q
[AR3]int l0
[AR3-LoopBack0]ip add 3.3.3.3 32
[AR3]int g 0/0/2
[AR3-GigabitEthernet0/0/2]ip add 192.168.1.3 24
AR4:
[Huawei]sys AR4
[AR4]int g0/0/0
[AR4-GigabitEthernet0/0/0]ip add 200.1.1.4 24
PC1:
(二)配置OSPF:
AR1:
[AR1]ospf 1 router
[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]ne 10.2.2.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]ne 1.1.1.1 0.0.0.0
[AR1-ospf-1-area-0.0.0.0]q
AR2:
[AR2]ospf 1 rou
[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]net 10.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]net
[AR2-ospf-1-area-0.0.0.0]net 10.3.3.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]net 2.2.2.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]q
AR3:
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]net
[AR3-ospf-1-area-0.0.0.0]network 10.2.2.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]net
[AR3-ospf-1-area-0.0.0.0]net 10.3.3.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]net 192.168.1.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]q
AR1配置静态路由让公网与内网通:
[AR1]ip route-static 0.0.0.0 0 200.1.1.4
(三)AR3配置静默接口,AR1下发缺省路由条目:
AR3:
[AR3]ospf 1
[AR3-ospf-1]si
[AR3-ospf-1]silent-interface g
[AR3-ospf-1]silent-interface GigabitEthernet 0/0/2
AR1:
[AR1]ospf 1
[AR1-ospf-1]de
[AR1-ospf-1]default
[AR1-ospf-1]default-route-advertise al
[AR1-ospf-1]default-route-advertise always
(四)AR1配置EASY IP(NAT):
[AR1]acl 2000
[AR1-acl-basic-2000]rule p
[AR1-acl-basic-2000]rule permit so
[AR1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[AR1-acl-basic-2000]q
[AR1]
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]nat out
[AR1-GigabitEthernet0/0/0]nat outbound 2000
(五)修改AR1到AR3之间路径的Cost值:
AR1:
[AR1]int g 0/0/2
[AR1-GigabitEthernet0/0/2]ospf cost 1000
AR3:
[AR3]int g 0/0/0
[AR3-GigabitEthernet0/0/0]ospf co
[AR3-GigabitEthernet0/0/0]ospf cost 1000