路由与交换技术实验(eNSP)

【Ctrl+P】显示上一条历史命令。如果需显示更早的历史命令,可以重复使用该功能键。

LACP-static

在这里插入图片描述
在这里插入图片描述

<Huawei>sys
[Huawei]sys SW1
[SW1]un in en
[SW1]interface Eth-Trunk 1
[SW1-Eth-Trunk1]mode lacp-static
[SW1-Eth-Trunk1]q
[SW1]interface Ethernet 0/0/20
[SW1-Ethernet0/0/20]eth-trunk 1
[SW1]interface Ethernet 0/0/21
用Ctrl+P完成
[SW1-Ethernet0/0/21]eth-trunk 1
[SW1]interface Ethernet 0/0/22
[SW1-Ethernet0/0/22]eth-trunk 1
[SW1]interface Ethernet0/0/1
[SW1-Ethernet0/0/1]port link-type access

在SW2上做同样的配置后再做
[SW2] interface Eth-Trunk 1
[SW2-Eth-Trunk1]max active-linknumber 2

[SW1] interface Eth-Trunk 1
【修改max active-linknumber】
创建聚合接口Eth-trunk1,并设置为工作在静态LACP方式,将最大活跃链路数设置为2:
[SW1-Eth-Trunk1]max active-linknumber 2
【开启lacp抢占】
[SW1-Eth-Trunk1]lacp preempt enable
【设置抢占时间为10秒】
[SW1-Eth-Trunk1]lacp preempt delay 10
【修改端口优先级PortPri】(按照10000改)
[SW1]interface Ethernet0/0/22
[SW1-Ethernet0/0/22]lacp priority 10000
【修改进程优先级system priority,在系统视图下配置】
[SW1]lacp priority 999
<SW1>save

VLAN+单线级联相关配置

在这里插入图片描述

SW1的配置:

<Huawei>sys
[Huawei] sys SW1
[SW1]interface Ethernet0/0/1
[SW1-Ethernet0/0/1]port link-type access 
[SW1-Ethernet0/0/1]interface Ethernet0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]interface Ethernet0/0/22
[SW1-Ethernet0/0/22]port link-type trunk
[SW1-Ethernet0/0/22]port trunk allow-pass vlan 10 20

[SW1]vlan 10
[SW1-vlan10]port Ethernet 0/0/1
[SW1]vlan 20
[SW1-vlan20]port Ethernet 0/0/2
<SW1>save

同理配置SW2

VLAN+3台交换机

在这里插入图片描述

组网目标:
PCA和PCC同属于一个VLAN 100且能相互通信。
PCB和PCD同属于另一个VLAN 200且能相互通信。
PC1、PC2、PC3、PC4都能互相通信

【步骤】
1、配置VLAN(SW1 & SW2 相同)

[SW1]vlan 100
[SW1-vlan100]port ethernet 0/0/1
[SW1-vlan100]vlan 200
[SW1-vlan200]port ethernet 0/0/2

2、配置端口链路类型

[SW1]interface Ethernet0/0/1
[SW1-Ethernet0/0/1]port link-type access
[SW1-Ethernet0/0/1]interface Ethernet0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]interface Ethernet0/0/22
[SW1-Ethernet0/0/22] port link-type trunk
[SW1-Ethernet0/0/22] port trunk allow-pass vlan 100  200 

3、配置SW3

[SW3]interface Ethernet0/0/22
[SW3-Ethernet0/0/22] port link-type trunk
[SW3-Ethernet0/0/22] port trunk allow-pass vlan 100  200 
[SW3]interface Ethernet0/0/21
[SW3-Ethernet0/0/21] port link-type trunk
[SW3-Ethernet0/0/21] port trunk allow-pass vlan 100  200 

[SW3]vlan batch 100 200
[SW3]interface Vlanif 100 //进入VLAN 100 虚接口
[SW3-Vlanif100]ip address 10.0.1.1  255.255.255.0
[SW3]int Vlanif 200
[SW3-Vlanif200]ip address 10.0.2.1 24

4、配置主机IP地址、子网掩码和默认网关。

其它命令:
在SW3上显示路由表display ip routing-table

交换机的远程控制

在这里插入图片描述

【仅密码登录】

< >sys
[ ]sys LSW1
[LSW1]un in en
[LSW1]interface Vlanif 1
VLAN Interface 逻辑接口
[LSW1-Vlanif1]ip address 10.0.0.1 24
[LSW1-Vlanif1]q
[LSW1]user-interface vty 0 4

user-interface 是指用户界面。vty,指虚拟终端。0 4 :表示可同时打开5个会话

[LSW1-ui-vty0-4]authentication-mode password
[LSW1-ui-vty0-4]set authentication password cipher 999
[LSW1-ui-vty0-4]user privilege level 15
[LSW1-ui-vty0-4]protocol inbound telnet

协议到达telnet

<>sys
[ ]sys LSW2
[LSW2]undo info-center enable
[LSW2]interface Vlanif 1
[LSW2-Vlanif1]ip address 10.0.0.2 24
[LSW2-Vlanif1]q
[LSW2]q
<LSW2>telnet 10.0.0.1
Password:999

【用户名+密码】
和“user-interface 是指用户界面。。。”上一样

[LSW1-ui-vty0-4]authentication-mode aaa
[LSW1]aaa
[LSW1-aaa]local-user test01 password cipher 123456
[LSW1-aaa]local-user test01 privilege level 15
[LSW1-aaa]local-user test01 service-type telnet

[LSW2]interface Vlanif 1
[LSW2-Vlanif1]ip address 10.0.0.2 24
[LSW2-Vlanif1]q
[LSW2]q
<LSW2>telnet 10.0.0.1
Password:123456

pap&chap

在这里插入图片描述

[PAP]
[RTA]aaa 
[RTA-aaa]local-user huawei password simple hello
[RTA-aaa]local-user huawei service-type ppp
[RTA]interface s 0/0/0
[RTA- Serial0/0/0]link-protocol ppp
[RTA- Serial0/0/0]ppp authentication-mode pap
[RTA- Serial0/0/0]ip address 10.1.1.1 30

[RTB]interface Serial 0/0/0  
[RTB- Serial0/0/0]link-protocol ppp
[RTB- Serial0/0/0]ppp pap local-user huawei password simple hello 
pap可以直接设置用户名和密码
[RTB- Serial0/0/0]ip address 10.1.1.2 30
[CHAP]
[RTA]aaa 
[RTA-aaa]local-user huawei password cipher hello 
[RTA-aaa]local-user huawei service-type ppp 
[RTA]interface Serial 0/0/0  
[RTA-Serial0/0/0]link-protocol ppp
[RTA-Serial0/0/0]ppp authentication-mode chap
[RTA-Serial0/0/0]ip address 10.1.1.1 30

[RTB]interface Serial 0/0/0  
[RTB-Serial0/0/0]link-protocol ppp
[RTB-Serial0/0/0]ppp chap user huawei
[RTB-Serial0/0/0]ppp chap password cipher hello
[RTB-Serial00/0/0]ip address 10.1.1.2 30
抓包:
shutdown

端口镜像

在这里插入图片描述

[SW1]observe-port 1 interface Ethernet 0/0/1
[SW1]interface Ethernet0/0/2
[SW1-Ethernet0/0/2]port-mirroring to observe-port 1 both(或Inbound或outbound)

将端口1作为管理口
执行命令display observe-port,查看上步所配置的管理口是否配置成功。如果信息中显示了端口0/0/1,说明配置成功。observe:监视

执行命令port-mirroring to observe-port 1 both,则将端口2设为镜像口。该命令中,both表示流量的方向是双向的,如果只想镜像出口流量,则将both改为outbound,只想镜像进口流量,则把both改为inbound 。

执行命令display port-mirroring查看所配置的镜像口。显示
Ethernet0/0/2 Both Ethernet0/0/1 ,说明配置成功。

route-static

在这里插入图片描述

[R1]interface Ethernet0/0/0
ip address 192.168.2.1 24
interface Serial0/0/0
ip address 192.168.1.1 24
ip route-static 192.168.3.0 24 192.168.1.2

告诉路由器去192.168.3.0 掩码是24 这个网段的数据包要通过192.168.1.2这个地址送出去。

[R2]interface Ethernet0/0/0
ip address 192.168.3.1 24
interface Serial0/0/0
ip address 192.168.1.2 24
ip route-static 192.168.2.0 24 192.168.1.1

route-rip

在这里插入图片描述

[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]interface s0/0/0
[R1-Serial0/0/0]ip address 192.168.2.1 24

[R1]rip
[R1-rip-1] version 2
[R1-rip-1] network 192.168.1.0
[R1-rip-1] network 192.168.2.0


[R2]interface s0/0/0
[R2-Serial0/0/0]ip address 192.168.2.2  24
[R2]interface s0/0/1
[R2-Serial0/0/0]ip address 192.168.3.1  24

[R2]rip
[R2-rip-1] version 2
[R2-rip-1] network 192.168.2.0
[R2-rip-1] network 192.168.3.0

[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.4.1 24
[R3-GigabitEthernet0/0/0]interface s0/0/0
[R3-Serial0/0/0]ip address 192.168.3.2 24
[R3-Serial0/0/0]quit
[R3]rip
[R3-rip-1] version 2

[R3-rip-1] network 192.168.3.0
[R3-rip-1] network 192.168.4.0
  • 2
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值