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

实验图:

目的:实现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`[email protected]`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`[email protected]`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>+/[email protected]: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,请小伙伴们自行配置,切不可将代码照抄照搬。。。

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

时间: 2024-10-09 14:04:16

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

华为模拟器实验单臂路由+动态地址池

华为单臂路由+动态地址池 实验拓扑: 实验目的:单臂路由实现动态地址池自动分配IP地址,并能连通. 实验步骤:1.首先如图,接好线,为交换机LSW1新增vlan10 ,vlan20,分配给e0/0/1和e0/0/2接口.为g0/0/1接口设置为中继口. 2.为路由器AR1的g0/0/1分别划为两个子接口,作为vlan 10 ,vlan20的网关,开启广播. 3.为2个子接口设置动态地址池. 4.双击c1,c2将ipv4配置为dhcp方式.进入命令行,用ipconfig命令查看,发现IP地址已经自

华为综合实验

一:链路聚合概述是将多个物理接口当作一个逻辑接口,以增加带宽和提供线路冗余.成员接口:是将加入Eth-Trunk时注意以下问题(1)每个Eth-Trunk接口最多可以包含8个成员接口(2)成员接口不能单独配置任何功能和静态MAC地址(3)成员接口加入Eth-Trunk时,必须为默认的hybrid类型接口(4)Eth-trunk接口不能嵌套,即成员接口不能是Eth-trunk(5)一个以太网接口中的成员接口必须是同一类型,即FE口和GE口不能加入同一个Eth-trunk接口(6)可以将不同接口板上

华为下的单臂路由

实验要求:不同的2个VLAN之间能够通信 过程如下: [SW1]vlan 10 [SW1-vlan10]q [SW1-vlan20] [SW1-vlan20]q [SW1] [SW1]int g0/0/2 [SW1-GigabitEthernet0/0/2]port link-type access (端口的链路类型) [SW1-GigabitEthernet0/0/2]port default vlan 10(把这个接口划分到vlan 10) [SW1-GigabitEthernet0/0/2

华为综合实验:VLAN技术与NAT技术

本实验使用华为eNSP模拟器,采用了VLAN技术.链路聚合.DHCP.静态路由.NAT.SSH远程管理等技术,搭建了一个简单的公司内网环境. 实验环境: 实验目的: 1. 实现全网互通 2. 实现PC上网 3. 实现服务器被公网用户访问 4. 实现SSH远程管理 实验步骤: 1. 配置两台二层交换机 sw1 <Huawei>system-view  [Huawei]sysname sw1 [sw1]vlan batch 10 20 [sw1]interface Eth-Trunk 1     

利用单臂路由器实现VLAN间路由

[实验目的] 掌握如何在路由器端口上划分子接口.封装Dot1q协议,实现VLAN间的路由. [需求分析]  需要在交换机上配置VLAN,然后在路由器连接交换机的端口上划分子接口,给相应的vlan设置IP地址,以实现VLAN间的路由. [实验设备]  路由器一台,交换机一台. [实验原理]  在交换路由中,通过VLAN对一个物理网络进行了逻辑划分,不同的VLAN之间是无法直接访问的,必须通过三次的路由设备来连接.一般利用路由器或三层交换机来实现不同VLAN间的互相访问.将路由器和交换机相连,使用I

Mycat读写分离以及拆库拆表综合实验3:通过日志分析mycat路由过程

#在客户端查询t1表中id=1的值 我们在之前的schma.cnf中定义了t1在是一张全局表,且位于名称为mysql的分片节点(datanode)上,因此当mycat拦截到客户端SQL语句之后,分析t1位于mysql分片节点上,直接发放该分片节点的readhost上 mysql > select * from t1 where id=1; 2018-05-25 10:16:16.906 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.backend.mysql.nio.M

单臂路由,三层交换机路由配置,动态路由配置

实验一.单臂路由 实验目标 在路由器上做单臂路由设置,实现不同VLAN   间的通信 实验环境 一台路由器,两台交换机,四台PC机, 设 PC0的ip:192.168.1.1    网关:192.168.1.254 PC1的ip:192.168.2.1    网关:192.168.2.254 PC2的ip:192.168.1.2    网关:192.168.1.254 PC3的ip:192.168.2.2    网关:192.168.2.254 实验步骤 对两台交换机的配置 对路由器的配置 结果

路由---单臂路由

实验 单臂路由 实验目标 用单臂路由,实现不同领域计算机之间的通信 实验环境 实验步骤 一.配置ip地址 二.创建vlan2.vlan3,将f0/1加入到vlan2,将f0/2加入到vlan3中 三.将f0/4设置为trunk模式 四.将f0/3设置为trunk模式 五.开启路由器f0/0接口,并封装f0/0.1 六.封装f0/0.2.配置IP 七.在switch1上创建vlan2.vlan3.并将f0/1加入到vlan2,将f0/2加入到vlan3中,设置f0/3接口为trunk 八.用PC1

ensp单臂路由学习笔记

交换机vlan路由实验--单臂路由方式 网络拓扑图: 路由器上的配置: <R>system-view [R]interface Ethernet 0/0/0.1 [R-Ethernet0/0/0.1]dot1q termination vid 10 [R-Ethernet0/0/0.1]ip address 192.168.1.1 255.255.255.0 [R-Ethernet0/0/0.1]q [R]interface Ethernet 0/0/0.2 [R-Ethernet0/0/0.