华为模拟器配置S5700交换机OSPF案例

华为模拟器配置S5700交换机OSPF测试案例

  • 测试目的及拓扑图
  • 交换机配置
    • 配置SwitchA
      • 1.配置各接口所属的VLAN
      • 2.配置各VLANIF接口的IP地址
      • 3.配置OSPF基本功能
    • 配置SwitchB。
      • 1.配置各接口所属的VLAN
      • 2.配置各VLANIF接口的IP地址
      • 3.配置OSPF基本功能
    • 配置SwitchC。
      • 1.配置各接口所属的VLAN
      • 2.配置各VLANIF接口的IP地址
      • 3.配置OSPF基本功能
    • 验证配置结果
      • 查看SwitchA的OSPF邻居。
      • 测试结果
  • 交换机配置文件
    • SwitchA配置文件
    • SwitchB配置文件
  • SwitchC配置文件

测试目的及拓扑图

实现局域网内全部vlan互通,对路由进行负载负担,vlan有10,20,30,40,网关分别为:192.168.0.2,192.168.1.2,192.168.2.1,192.168.3.1,子网掩码都为255.255.255.0,网络拓扑图如下:
华为模拟器配置S5700交换机OSPF案例_第1张图片

交换机配置

配置SwitchA

1.配置各接口所属的VLAN

sysname SwitchA
vlan batch 10 20 
#
int gi0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 40
 quit
#
int gi0/0/2
 port link-type trunk
 port trunk allow-pass vlan 20 40
 quit
#
interface gi0/0/3
 port link-type access
 port default vlan 40
#

2.配置各VLANIF接口的IP地址

interface vlanif 10
 ip address 192.168.0.1 24
 quit
inter  vlanif 20
 ip address 192.168.1.1 24
 quit
interface Vlanif40
 ip address 192.168.3.1 255.255.255.0
#

3.配置OSPF基本功能

ospf 1 router-id 10.1.1.1
 area 0
  network 192.168.0.0 0.0.0.255
  quit
 area 1
  network 192.168.1.0 0.0.0.255
  quit
 area 4
  network 192.168.3.0 0.0.0.255
  quit
 quit

配置SwitchB。

1.配置各接口所属的VLAN

sysname SwitchB
vlan batch 10 20 30 40
#
int gi0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
 quit
#

2.配置各VLANIF接口的IP地址

interface vlanif 10
 ip address 192.168.0.2 24
 quit
#
int vlanif 30
 ip address 192.168.2.1 24
 quit

3.配置OSPF基本功能

ospf 1 router-id 10.2.2.2
 area 0
  network 192.168.0.0 0.0.0.255
 area 3
  network 192.168.2.0 0.0.0.255
  quit
 quit
#

配置SwitchC。

1.配置各接口所属的VLAN

sysname SwitchC
vlan batch 10 20 40
#
int gi0/0/1
 port link-type trunk
 port trunk allow-pass vlan 20
 quit
#
interface gi0/0/9
 port link-type access
 port default vlan 20
#
interface gi0/0/10
 port link-type access
 port default vlan 40
#

2.配置各VLANIF接口的IP地址

inter  vlanif 20
 ip address 192.168.1.2 24
 quit

3.配置OSPF基本功能

ospf 1 router-id 10.3.3.3
 area 1
  network 192.168.1.0 0.0.0.255
  quit

验证配置结果

查看SwitchA的OSPF邻居。

display ospf peer

测试结果

所有终端互ping,全通,所有交换机互ping全通。

交换机配置文件

SwitchA配置文件

#
sysname SwitchA
#
vlan batch 10 20 40
#
interface Vlanif10
 ip address 192.168.0.1 255.255.255.0
#
interface Vlanif20
 ip address 192.168.1.1 255.255.255.0
#
interface Vlanif40
 ip address 192.168.3.1 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 40
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 20 40
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 40
#
ospf 1 router-id 10.1.1.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
 area 0.0.0.4
  network 192.168.3.0 0.0.0.255
#

SwitchB配置文件

#
sysname SwitchB
#
vlan batch 10 20 30 40
#
#
interface Vlanif10
 ip address 192.168.0.2 255.255.255.0
#
interface Vlanif30
 ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 40
#
interface GigabitEthernet0/0/9
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/10
 port link-type access
 port default vlan 30
#
interface GigabitEthernet0/0/11
 port link-type access
 port default vlan 40
#
ospf 1 router-id 10.2.2.2
 area 0.0.0.0
  network 192.168.0.0 0.0.0.255
 area 0.0.0.3
  network 192.168.2.0 0.0.0.255
#

SwitchC配置文件

#
sysname SwitchC
#
vlan batch 10 20 40
#
interface Vlanif20
 ip address 192.168.1.2 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20 40
#
interface GigabitEthernet0/0/9
 port link-type access
 port default vlan 20
#
interface GigabitEthernet0/0/10
 port link-type access
 port default vlan 40
#
ospf 1 router-id 10.3.3.3
 area 0.0.0.1
  network 192.168.1.0 0.0.0.255
#

你可能感兴趣的:(网络管理)