码迷,mamicode.com
首页 > 其他好文 > 详细

华为综合实验——单臂、三层交换、动静路由、VRRP路由、DHCP中继、捆绑Etrunk

时间:2019-11-12 11:19:07      阅读:86      评论:0      收藏:0      [点我收藏+]

标签:ddr   cluster   imp   service   serve   file   enable   add   rop   

实验图:

目的:实现pc1、2、5、6的数据互相传输
技术图片

跟我一起,盘它

LSW3

#
sysname SW3
#
vlan batch 10 20
#
lacp priority 1000
#
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 MEth0/0/1
#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface Eth-Trunk2
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface Ethernet0/0/1
 eth-trunk 1
#
interface Ethernet0/0/2
 eth-trunk 1
#
interface Ethernet0/0/3
 eth-trunk 2
#
interface Ethernet0/0/4
 eth-trunk 2
#
interface Ethernet0/0/5
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/6
 port link-type access
 port default vlan 20

LSW4

#
sysname SW4
#
vlan batch 30 40
#
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 MEth0/0/1
#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 30 40
#
interface Eth-Trunk2
 port link-type trunk
 port trunk allow-pass vlan 30 40
#
interface Ethernet0/0/1
 eth-trunk 1
#
interface Ethernet0/0/2
 eth-trunk 1
#
interface Ethernet0/0/3
 eth-trunk 2
#
interface Ethernet0/0/4
 eth-trunk 2
#
interface Ethernet0/0/5
 port link-type access
 port default vlan 30
#
interface Ethernet0/0/6
 port link-type access
 port default vlan 40

LSW1

#
sysname SW1
#
vlan batch 10 20 30 40 50
#
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 Vlanif10
 ip address 192.168.10.2 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.10.1
 vrrp vrid 1 priority 120
 vrrp vrid 1 track interface Eth-Trunk1
 vrrp vrid 1 track interface Eth-Trunk3
#
interface Vlanif20
 ip address 192.168.20.2 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.20.1
 vrrp vrid 2 priority 115
#
interface Vlanif30
 ip address 192.168.30.2 255.255.255.0
 vrrp vrid 3 virtual-ip 192.168.30.1
 vrrp vrid 3 priority 120
 vrrp vrid 3 track interface Eth-Trunk2
 vrrp vrid 3 track interface Eth-Trunk3
#
interface Vlanif40
 ip address 192.168.40.2 255.255.255.0
 vrrp vrid 4 virtual-ip 192.168.40.1
 vrrp vrid 4 priority 115
#
interface Vlanif50
 ip address 13.0.0.2 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface Eth-Trunk2
 port link-type trunk
 port trunk allow-pass vlan 30 40
#
interface Eth-Trunk3
 port link-type access
 port default vlan 50
#
interface GigabitEthernet0/0/1
 eth-trunk 1
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 2
#
interface GigabitEthernet0/0/4
 eth-trunk 2
#
interface GigabitEthernet0/0/5
 eth-trunk 3
#
interface GigabitEthernet0/0/6
 eth-trunk 3
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 13.0.0.1
#

LSW2

#
sysname SW2
#
vlan batch 10 20 30 40 50
#
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 Vlanif10
 ip address 192.168.10.3 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.10.1
 vrrp vrid 1 priority 115
#
interface Vlanif20
 ip address 192.168.20.3 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.20.1
 vrrp vrid 2 priority 120
 vrrp vrid 2 track interface Eth-Trunk2
 vrrp vrid 2 track interface Eth-Trunk3
#
interface Vlanif30
 ip address 192.168.30.3 255.255.255.0
 vrrp vrid 3 virtual-ip 192.168.30.1
 vrrp vrid 3 priority 115
#
interface Vlanif40
 ip address 192.168.40.3 255.255.255.0
 vrrp vrid 4 virtual-ip 192.168.40.1
 vrrp vrid 4 priority 120
 vrrp vrid 4 track interface Eth-Trunk3
 vrrp vrid 4 track interface Eth-Trunk1
#
interface Vlanif50
 ip address 12.0.0.2 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 30 40
#
interface Eth-Trunk2
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface Eth-Trunk3
 port link-type access
 port default vlan 50
#
interface GigabitEthernet0/0/1
 eth-trunk 1
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 2
#
interface GigabitEthernet0/0/4
 eth-trunk 2
#
interface GigabitEthernet0/0/5
 eth-trunk 3
#
interface GigabitEthernet0/0/6
 eth-trunk 3
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 12.0.0.1
#

R1

#
sysname R1
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password cipher +(V`Q@`WtC3IF$‘:[285RM1#
 local-user admin service-type http
#
firewall zone Local
 priority 16
#
interface Eth-Trunk3
 ip address 13.0.0.1 255.255.255.0
#
interface Eth-Trunk4
 ip address 12.0.0.1 255.255.255.0
#
interface Ethernet0/0/0
#
interface Ethernet0/0/1
#
interface Serial0/0/0
 link-protocol ppp
 ip address 11.0.0.1 255.255.255.252
#
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
 eth-trunk 3
#
interface GigabitEthernet0/0/1
 eth-trunk 3
#
interface GigabitEthernet0/0/2
 eth-trunk 4
#
interface GigabitEthernet0/0/3
 eth-trunk 4
#
wlan
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 11.0.0.2
ip route-static 192.168.10.0 255.255.255.0 13.0.0.2
ip route-static 192.168.10.0 255.255.255.0 12.0.0.2 preference 70
ip route-static 192.168.20.0 255.255.255.0 13.0.0.2 preference 70
ip route-static 192.168.20.0 255.255.255.0 12.0.0.2
ip route-static 192.168.30.0 255.255.255.0 13.0.0.2
ip route-static 192.168.30.0 255.255.255.0 12.0.0.2 preference 70
ip route-static 192.168.40.0 255.255.255.0 13.0.0.2 preference 70
ip route-static 192.168.40.0 255.255.255.0 12.0.0.2
#

R2

#
sysname R2
#
dhcp enable
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password cipher +(V`Q@`WtC:z9:%F`[a=6M4#
 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
 ip address 11.0.0.2 255.255.255.252
#
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
#
interface GigabitEthernet0/0/0.100
 dot1q termination vid 100
 ip address 192.168.100.1 255.255.255.0
 arp broadcast enable
 dhcp select relay
 dhcp relay server-ip 23.0.0.2
#
interface GigabitEthernet0/0/0.200
 dot1q termination vid 200
 ip address 192.168.200.1 255.255.255.0
 arp broadcast enable
 dhcp select relay
 dhcp relay server-ip 23.0.0.2
#
interface GigabitEthernet0/0/1
 ip address 23.0.0.1 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 23.0.0.2
ip route-static 192.168.0.0 255.255.0.0 11.0.0.1
#

R3

#
sysname Huawei
#
dhcp enable
#
ip pool dhcp100
 gateway-list 192.168.100.1
 network 192.168.100.0 mask 255.255.255.0
 dns-list 8.8.8.8 2.2.2.2
#
ip pool dhcp200
 gateway-list 192.168.200.1
 network 192.168.200.0 mask 255.255.255.0
 dns-list 8.8.8.8 2.2.2.2
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password cipher -$[1(P>3t>+/Y@:Y>Lw(YM6#
 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
#
interface GigabitEthernet0/0/1
 ip address 23.0.0.2 255.255.255.0
 dhcp select global
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
wlan
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 23.0.0.1
#

LSW5

#
sysname SW5
#
vlan batch 100 200
#
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 MEth0/0/1
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 100
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 200
#
interface Ethernet0/0/3
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface Ethernet0/0/8
#
interface Ethernet0/0/9
#
interface Ethernet0/0/10
#
interface Ethernet0/0/11
#
interface Ethernet0/0/12
#
interface Ethernet0/0/13
#
interface Ethernet0/0/14
#
interface Ethernet0/0/15
#
interface Ethernet0/0/16
#
interface Ethernet0/0/17
#
interface Ethernet0/0/18
#
interface Ethernet0/0/19
#
interface Ethernet0/0/20
#
interface Ethernet0/0/21
#
interface Ethernet0/0/22
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#

测试是否有BUG

1、PC5、PC6能获取到DHCP服务器提供的IP地址
技术图片
技术图片

2、四台pc能实现数据的互联互通

技术图片
技术图片
技术图片
技术图片

由此,实验配置毫无problem,请小伙伴们自行配置,切不可将代码照抄照搬。。。

华为综合实验——单臂、三层交换、动静路由、VRRP路由、DHCP中继、捆绑Etrunk

标签:ddr   cluster   imp   service   serve   file   enable   add   rop   

原文地址:https://blog.51cto.com/14475593/2449573

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!