单核心网络配置实例(Ensp)

本文介绍了一个简单的单核心网络架构案例,包括接入层、汇聚层和核心层的设备配置。通过二层VLAN和三层VLAN实现全网互通,并使用OSPF路由协议进行路由选择。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

拓扑图:包含vlan、地址规划

配置:

<jieru_A>

<jieru_A>dis cu

#

sysname jieru_A

#

vlan batch 10 20 30

#

ip pool vlan1

 gateway-list 192.168.0.254

#

interface Vlanif1

 ip address 192.168.0.1 255.255.255.0

#

interface Vlanif10

 ip address 172.16.10.2 255.255.255.0

#

interface Vlanif20

 ip address 172.16.20.2 255.255.255.0

#

interface Vlanif30

 ip address 172.16.30.2 255.255.255.0

#

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

ip route-static 0.0.0.0 0.0.0.0 192.168.128.44

ip route-static 192.168.128.40 255.255.255.248 172.16.10.1

ip route-static 192.168.128.40 255.255.255.248 172.16.30.1

#

user-interface con 0

user-interface vty 0 4

#

return

 

<jieru_B>dis cu

#

sysname jieru_B

#

vlan batch 10 20 30

#

ip pool vlan1

 gateway-list 192.168.0.254

#

interface Vlanif1

 ip address 192.168.0.2 255.255.255.0

#

interface Vlanif10

 ip address 172.16.10.3 255.255.255.0

#

interface Vlanif20

 ip address 172.16.20.3 255.255.255.0

#

interface Vlanif30

 ip address 172.16.30.3 255.255.255.0

#

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

ip route-static 0.0.0.0 0.0.0.0 192.168.128.44

ip route-static 192.168.128.40 255.255.255.248 172.16.10.1

ip route-static 192.168.128.40 255.255.255.248 172.16.20.1

#

user-interface con 0

user-interface vty 0 4

#

return

 

<jieru_C>

<jieru_C>dis cu

#

sysname jieru_C

#

vlan batch 50 60 70

#

ip pool vlan1

 gateway-list 192.168.0.254

#

interface Vlanif1

 ip address 192.168.0.3 255.255.255.0

#

interface Vlanif50

 ip address 172.18.50.2 255.255.255.0

#

interface Vlanif60

 ip address 172.18.60.2 255.255.255.0

#

interface Vlanif70

 ip address 172.18.70.2 255.255.255.0

#

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

ip route-static 0.0.0.0 0.0.0.0 192.168.129.44

ip route-static 192.168.129.40 255.255.255.248 172.18.50.1

ip route-static 192.168.129.40 255.255.255.248 172.18.60.1

ip route-static 192.168.129.40 255.255.255.248 172.18.70.1

#

user-interface con 0

user-interface vty 0 4

#

return

 

 

<jieru_D>dis cu

#

sysname jieru_D

#

vlan batch 50 60 70

#

ip pool vlan1

 gateway-list 192.168.0.254

#

interface Vlanif1

 ip address 192.168.0.4 255.255.255.0

#

interface Vlanif50

 ip address 172.18.50.3 255.255.255.0

#

interface Vlanif60

 ip address 172.18.60.3 255.255.255.0

#

interface Vlanif70

 ip address 172.18.70.3 255.255.255.0

#

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

ip route-static 0.0.0.0 0.0.0.0 192.168.129.44

ip route-static 192.168.129.40 255.255.255.248 172.18.50.1

ip route-static 192.168.129.40 255.255.255.248 172.18.60.1

ip route-static 192.168.129.40 255.255.255.248 172.18.70.1

#

user-interface con 0

user-interface vty 0 4

#

return

 

 

<huiju_A>dis cu

#

sysname huiju_A

#

vlan batch 10 20 30 100

#

ip pool vlan1

 gateway-list 192.168.0.254

#

interface Vlanif1

 ip address 192.168.0.5 255.255.255.0

#

interface Vlanif10

 ip address 172.16.10.1 255.255.255.0

#

interface Vlanif20

 ip address 172.16.20.1 255.255.255.0

#

interface Vlanif30

 ip address 172.16.30.1 255.255.255.0

#

interface Vlanif100

 ip address 192.168.128.44 255.255.255.248

#

interface MEth0/0/1

#

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/2

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/3

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

ospf 1

 area 0.0.0.0

  network 172.16.10.0 0.0.0.255

  network 172.16.20.0 0.0.0.255

  network 172.16.30.0 0.0.0.255

  network 192.168.128.40 0.0.0.7

#

user-interface con 0

user-interface vty 0 4

#

return

 

 

<huiju_B>dis cu

#

sysname huiju_B

#

vlan batch 50 60 70 200

#

ip pool vlan1

 gateway-list 192.168.0.254

#

interface Vlanif1

 ip address 192.168.0.6 255.255.255.0

#

interface Vlanif50

 ip address 172.18.50.1 255.255.255.0

#

interface Vlanif60

 ip address 172.18.60.1 255.255.255.0

#

interface Vlanif70

 ip address 172.18.70.1 255.255.255.0

#

interface Vlanif200

 ip address 192.168.129.44 255.255.255.248

#

interface MEth0/0/1

#

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/2

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/3

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

ospf 1

 area 0.0.0.0

  network 172.18.50.0 0.0.0.255

  network 172.18.60.0 0.0.0.255

  network 172.18.70.0 0.0.0.255

  network 192.168.129.40 0.0.0.7

#

user-interface con 0

user-interface vty 0 4

#

return

 

 

<hexin_switch>dis cu

#

sysname hexin_switch

#

vlan batch 100 200 300

#

interface Vlanif1

 ip address 192.168.0.254 255.255.255.0

#

interface Vlanif100

 ip address 192.168.128.45 255.255.255.248

#

interface Vlanif200

 ip address 192.168.129.45 255.255.255.248

#

interface Vlanif300

 ip address 192.168.86.17 255.255.255.240

#

interface MEth0/0/1

#

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/2

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

#

interface GigabitEthernet0/0/10

 port link-type access

 port default vlan 300

#

ospf 1

 import-route direct

 area 0.0.0.0

  network 192.168.86.16 0.0.0.15

  network 192.168.128.40 0.0.0.7

  network 192.168.129.40 0.0.0.7

#

user-interface con 0

user-interface vty 0 4

#

return

 

 

[router-GigabitEthernet0/0/0]dis cu

#

sysname router

#

acl number 2000

 rule 10 permit

#

interface GigabitEthernet0/0/0

 ip address 192.168.86.30 255.255.255.240

 nat static protocol tcp global 210.96.100.86 any inside 192.168.86.30 any netma

sk 255.255.255.255

#

interface GigabitEthernet0/0/1

 ip address 210.96.100.85 255.255.255.252

 nat outbound 2000

#

ospf 1

 import-route direct

 area 0.0.0.0

  network 210.96.100.84 0.0.0.3

  network 192.168.86.16 0.0.0.15

#

user-interface con 0

user-interface vty 0 4

user-interface vty 16 20

#

return



这个实例只做到全网通就可以,可以基本了解单核心网络架构的问题。通过二层vlan和三层vlan实现全网通,路由器和交换机采用ospf,在后期的学习中自己可以加入备份、acl、nat等功能。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值