目录
要求
配置思路
配置文件 顺序 R2 R1 R3 SW1 SW2 SW3 SW6
测试结果
1、按照拓扑图规划网络;
2、实现网络全网互通,总部实现默认路由下发,降低设备要求;
3、二层网络实现流量负载分担;
4、总部网络终端实现网关冗余备份,且实现上行链路监控;
5、总部网络终端主机使用dhcp获得ip;
6、总部网络汇聚层实现链路聚合(动态,最大链路数5条,可激活3条);
7、分部终端要尽快进入转发状态,且上下线不会造成网络震荡;MSTP
8、总部vlan 10之间不能互相访问,vlan 20之间可互相访问。端口隔离
9 ,PC 2 3 4 DHCP 获取地址
注:1 由于是运营商网络 在LSP中不能出现私网ip因此 vlan 10 20 30 40 使用 MPLS VPN 隧道连接
2 接口绑定实例后接口已有的配置会自动删除 因此先接入实例后配置地址
3 先创建Eth-trunk 组并在端口加入,后配置三层交换机
4 在SW1 SW2 创建接口下DHCP
1 LSP骨干网ospf 联通R1 R2 R3
2 开启 R1 R2 R3 mpls ldp
3 创建 R2 R3 VPN 实例
4 接口绑定 VPN 实例
5 配置接口地址
6 配置MPLS VPN 用户接入
7 在配置 vlan 10 20 30 40 时一并配置 VRRP 和 链路聚合
8 测试 排错
已给配置
R2配置
#
sysname r2
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
ip -instance 1
ipv4-family
route-distinguisher 1020:3040
-target 1020:4321 export-extcommunity
-target 1020:1234 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 41.0.0.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding -instance 1
ip address 41.0.1.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip binding -instance 1
ip address 41.0.2.1 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.0
#
bgp 100
router-id 2.2.2.2
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
#
ipv4-family v4
policy -target
peer 3.3.3.3 enable
#
ipv4-family -instance 1
import-route ospf 2
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 41.0.0.0 0.0.0.255
#
ospf 2 -instance 1
import-route bgp
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 41.0.1.0 0.0.0.255
network 41.0.2.0 0.0.0.255
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
R1配置
#
sysname r1
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 41.0.0.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 51.0.0.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.0
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 41.0.0.0 0.0.0.255
network 51.0.0.0 0.0.0.255
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
R3 配置
#
sysname r3
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
ip -instance 1
ipv4-family
route-distinguisher 1020:3040
-target 1020:1234 export-extcommunity
-target 1020:4321 import-extcommunity
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 51.0.0.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding -instance 1
ip address 51.0.1.1 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.0
#
bgp 100
router-id 3.3.3.3
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 2.2.2.2 enable
#
ipv4-family v4
policy -target
peer 2.2.2.2 enable
#
ipv4-family -instance 1
import-route ospf 3
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 51.0.0.0 0.0.0.255
#
ospf 3 -instance 1
import-route bgp
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 51.0.1.0 0.0.0.255
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
SW1 配置
#
sysname sw 1
#
vlan batch 10 20 50 60
#
stp instance 1 priority 4096
stp instance 2 priority 8192
#
lacp priority 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
dhcp enable
#
diffserv domain default
#
stp region-configuration
region-name mstp
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.100 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 150
vrrp vrid 10 track interface GigabitEthernet0/0/24 reduced 60
dhcp select interface
dhcp server excluded-ip-address 192.168.10.251
dhcp server dns-list 8.8.8.8
#
interface Vlanif20
ip address 192.168.20.100 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
#
interface Vlanif50
ip address 41.0.1.2 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
max active-linknumber 3
#
interface GigabitEthernet0/0/20
eth-trunk 1
lacp priority 100
#
interface GigabitEthernet0/0/21
eth-trunk 1
lacp priority 100
#
interface GigabitEthernet0/0/22
eth-trunk 1
#
interface GigabitEthernet0/0/23
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/24
port link-type access
port default vlan 50
#
interface NULL0
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.0
ospf network-type broadcast
#
ospf 200
area 0.0.0.0
network 41.0.1.0 0.0.0.255
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return
SW 2
#
sysname sw 2
#
vlan batch 10 20 50 60
#
stp instance 1 priority 8192
stp instance 2 priority 4096
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
dhcp enable
#
diffserv domain default
#
stp region-configuration
region-name mstp
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.200 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
#
interface Vlanif20
ip address 192.168.20.200 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 150
vrrp vrid 20 track interface GigabitEthernet0/0/24 reduced 60
dhcp select interface
dhcp server dns-list 8.8.8.8
#
interface Vlanif60
ip address 41.0.2.2 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
max active-linknumber 3
#
interface GigabitEthernet0/0/20
eth-trunk 1
#
interface GigabitEthernet0/0/21
eth-trunk 1
#
interface GigabitEthernet0/0/22
eth-trunk 1
#
interface GigabitEthernet0/0/23
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/24
port link-type access
port default vlan 60
#
interface NULL0
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.0
ospf network-type broadcast
#
ospf 200
area 0.0.0.0
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
network 41.0.2.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return
SW3配置
#
sysname sw 3
#
vlan batch 10 20 50 60 200
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
vlan 200
mux-vlan
subordinate separate 10
subordinate group 20
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
port mux-vlan enable
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
port mux-vlan enable
#
interface Ethernet0/0/3
port link-type access
port default vlan 20
port mux-vlan enable
#
interface Ethernet0/0/4
port link-type access
port default vlan 20
port mux-vlan enable
#
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 NULL0
#
user-interface con 0
user-interface vty 0 4
#
return
SW6 配置
#
sysname sw 6
#
vlan batch 30 40 70
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif30
ip address 172.16.1.1 255.255.255.0
#
interface Vlanif40
ip address 172.16.2.1 255.255.255.0
#
interface Vlanif70
ip address 51.0.1.2 255.255.255.0
#
interface MEth0/0/1
#
interface Ethernet0/0/1
port link-type access
port default vlan 30
#
interface Ethernet0/0/2
port link-type access
port default vlan 40
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 70
#
interface GigabitEthernet0/0/2
Oct 20 2022 15:50:06-08:00 sw 6 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 46, the
change loop count is 0, and the maximum number of records is 4095.#
interface NULL0
#
interface LoopBack0
ip address 6.6.6.6 255.255.255.0
ospf network-type broadcast
#
ospf 300
area 0.0.0.0
network 51.0.1.0 0.0.0.255
network 172.16.1.0 0.0.0.255
network 172.16.2.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return
PC1 能 ping 通 CLIENT5 反之亦然 且 R1 R2 R3 路由表中无私网路由
[r2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 1 D 41.0.0.2 GigabitEthernet
0/0/0
2.2.2.0/24 Direct 0 0 D 2.2.2.2 LoopBack0
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
3.3.3.3/32 OSPF 10 2 D 41.0.0.2 GigabitEthernet
0/0/0
41.0.0.0/24 Direct 0 0 D 41.0.0.1 GigabitEthernet
0/0/0
41.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
41.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
51.0.0.0/24 OSPF 10 2 D 41.0.0.2 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0