使用ensp搭建路由拓撲,並使用ospf協議實現網路互通實操

香吧香發表於2023-10-08

轉載請註明出處:

1.使用ENSP 搭建如下拓撲:

                          

資料準備

  為完成此配置例,需準備如下的資料:

裝置

Router ID

Process ID

IP地址

DeviceA

1.1.1.1

1

區域0:192.168.0.0/24

區域1:192.168.1.0/24

DeviceB

2.2.2.2

1

區域0:192.168.0.0/24

區域2:192.168.2.0/24

DeviceC

3.3.3.3

1

區域1:192.168.1.0/24、172.16.1.0/24

DeviceD

4.4.4.4

1

區域2:192.168.2.0/24、172.17.1.0/24

DeviceE

5.5.5.5

1

區域1:172.16.1.0/24

DeviceF

6.6.6.6

1

區域2:172.17.1.0/24

2.配置ospf

  DeviceA配置如下:

<Huawei>display current-configuration configuration ospf
#
ospf 1
 area 0.0.0.0
  network 192.168.0.0 0.0.0.255
 area 0.0.0.1
  network 192.168.1.0 0.0.0.255
#
return
<Huawei>display current-configuration interface Ethernet 0/0/1
#
interface Ethernet0/0/1
 ip address 192.168.1.1 255.255.255.0
#
return
<Huawei>display current-configuration interface Ethernet 0/0/0
#
interface Ethernet0/0/0
 ip address 192.168.0.1 255.255.255.0
#
return
<Huawei>

  DeviceB 配置:

<Huawei>display current-configuration configuration ospf
#
ospf 1
 area 0.0.0.0
  network 192.168.0.0 0.0.0.255
 area 0.0.0.2
  network 192.168.2.0 0.0.0.255
#
return
<Huawei>display current-configuration interface Ethernet 0/0/0
#
interface Ethernet0/0/0
 ip address 192.168.0.2 255.255.255.0
#
return
<Huawei>display current-configuration interface Ethernet 0/0/1
#
interface Ethernet0/0/1
 ip address 192.168.2.1 255.255.255.0
#
return
<Huawei>

  DeviceC 配置:

<Huawei>display current-configuration configuration ospf
#
ospf 1
 area 0.0.0.1
  network 192.168.1.0 0.0.0.255
  network 172.16.1.0 0.0.0.255
#
return
<Huawei>display current-configuration interface Ethernet 0/0/0
#
interface Ethernet0/0/0
 ip address 192.168.1.2 255.255.255.0
#
return
<Huawei>display current-configuration interface Ethernet 0/0/1
#
interface Ethernet0/0/1
 ip address 172.16.1.1 255.255.255.0
#
return
<Huawei>

  DeviceD配置如下:

<Huawei>display current-configuration configuration ospf
#
ospf 1
 area 0.0.0.2
  network 192.168.2.0 0.0.0.255
  network 172.17.1.0 0.0.0.255
#
return
<Huawei>display current-configuration interface Ethernet 0/0/0
#
interface Ethernet0/0/0
 ip address 192.168.2.2 255.255.255.0
#
return
<Huawei>display current-configuration interface Ethernet 0/0/1
#
interface Ethernet0/0/1
 ip address 172.17.1.1 255.255.255.0
#
return
<Huawei>

  DeviceE配置如下:

<Huawei>display current-configuration configuration ospf
#
ospf 1
 area 0.0.0.1
  network 172.16.1.0 0.0.0.255
#
return
<Huawei>display current-configuration interface Ethernet 0/0/0
#
interface Ethernet0/0/0
 ip address 172.16.1.2 255.255.255.0
#
return
<Huawei>

  DeviceF配置如下:

<Huawei>display current-configuration configuration ospf
#
ospf 1
 area 0.0.0.2
  network 172.17.1.0 0.0.0.255
#
return
<Huawei>
<Huawei>display current-configuration interface Ethernet 0/0/0
#
interface Ethernet0/0/0
 ip address 172.17.1.2 255.255.255.0
#
return
<Huawei>
<Huawei>

3.驗證網路是否打通:

  在 DeviceE 裝置上ping 另一個邊緣區域的DeviceF,並跟蹤過程:

                    

 4.分別檢視每個裝置上的路由和ospf路由:

  DeviceA 的路由表和ospf 路由表:

                   

   DeviceB 的路由表和ospf 路由表:

                   

   DeviceC 的路由表和ospf 路由表:

                     

   DeviceD 的路由表和ospf 路由表:

                     

   DeviceE 的路由表和ospf 路由表:

                  

   DeviceF 的路由表和ospf 路由表:

                   

 

相關文章