1.网络拓扑图
链接:https://pan.baidu.com/s/14ehv6iO6VQoIAEMzcU3gxw
提取码:8888
eNSP
链接:https://pan.baidu.com/s/1wP0vHim4yqVV0bc0wmzhFw
提取码:8888
2、网络需求
a.在R2和R3相应的接口激活OSPF;R1不运行任何动态路由协议;
b. R2上配置去往192.168.1.0/24的静态路由;为了让OSPF域内的路由器能够通过OSPF学习到这条路由,在R2上将静态路由重发布到OSPF。
c.完成配置后要求PC1与PC2能够互访。
3、配置
给R1配置一条默认路由:
[R1] ip route-static 0.0.0.0 0.0.0.0 192.168.12.2
在R2的GE0/0/1口上激活OSPF:
[R2] ospf 1 router-id 2.2.2.2
[R2-ospf-1] area 0
[R2-ospf-1-area-0.0.0.0] network 192.168.23.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0] quit
[R2-ospf-1] quit
在R2上将静态路由重发布到OSPF。
[R2] ospf 1
[R2-ospf-1] import-route static
在R3的GE0/0/0及GE0/0/1口上激活OSPF:
[R3] ospf 1 router-id 3.3.3.3
[R3-ospf-1] area 0
[R3-ospf-1-area-0.0.0.0] network 192.168.23.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
4.R1的配置
display current-configuration
sysname R1
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http
firewall zone Local
priority 16
interface Ethernet0/0/0
interface Ethernet0/0/1
interface Serial0/0/0
link-protocol ppp
interface Serial0/0/1
link-protocol ppp
interface Serial0/0/2
link-protocol ppp
interface Serial0/0/3
link-protocol ppp
interface GigabitEthernet0/0/0
ip address 192.168.12.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.1.254 255.255.255.0
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
wlan
interface NULL0
ip route-static 0.0.0.0 0.0.0.0 192.168.12.2
user-interface con 0
user-interface vty 0 4
user-interface vty 16 20
return
5、R2的配置
display current-configuration
sysname R2
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http
firewall zone Local
priority 16
interface Ethernet0/0/0
interface Ethernet0/0/1
interface Serial0/0/0
link-protocol ppp
interface Serial0/0/1
link-protocol ppp
interface Serial0/0/2
link-protocol ppp
interface Serial0/0/3
link-protocol ppp
interface GigabitEthernet0/0/0
ip address 192.168.12.2 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.23.2 255.255.255.0
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
wlan
interface NULL0
ospf 1 router-id 2.2.2.2
import-route static
area 0.0.0.0
network 192.168.23.0 0.0.0.255
ip route-static 192.168.1.0 255.255.255.0 192.168.12.1
user-interface con 0
user-interface vty 0 4
user-interface vty 16 20
return
6、R3的配置
display current-configuration
Nov 8 2020 11:54:25-08:00 R3 %%01PHY/1/PHY(l)[15]: GigabitEthernet0/0/1: cha
nge status to down
Nov 8 2020 11:54:25-08:00 R3 %%01IFNET/4/LINK_STATE(l)[16]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the DOWN state.
sysname R3
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http
firewall zone Local
priority 16
interface Ethernet0/0/0
interface Ethernet0/0/1
interface Serial0/0/0
link-protocol ppp
interface Serial0/0/1
link-protocol ppp
interface Serial0/0/2
link-protocol ppp
interface Serial0/0/3
link-protocol ppp
interface GigabitEthernet0/0/0
ip address 192.168.23.3 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.2.254 255.255.255.0
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
wlan
interface NULL0
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 192.168.23.0 0.0.0.255
network 192.168.2.0 0.0.0.255
user-interface con 0
user-interface vty 0 4
user-interface vty 16 20
Nov 8 2020 11:54:26-08:00 R3 %%01PHY/1/PHY(l)[17]: GigabitEthernet0/0/1: cha
nge status to up
Nov 8 2020 11:54:26-08:00 R3 %%01IFNET/4/LINK_STATE(l)[18]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.#
return
7.通讯测试