(3)单臂路由的测试(直接上手)

需求:实现不同vlan能够ping通

SW1配置:

The device is running!
//切换系统视图	
<Huawei>sy	
<Huawei>system-view 
//修改交换机名称	
[Huawei]sysname SW1


//批量划分vlan
[SW1]vla	
[SW1]vlan  b	
[SW1]vlan  batch 10 20


//关掉信息提示	
[SW1]undo in en	
//进接口配置access链路
[SW1]int e0/0/1进接口配置
[SW1-Ethernet0/0/1]p l a
[SW1-Ethernet0/0/1]p d v 10
[SW1-Ethernet0/0/1]un sh

[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]p l a
[SW1-Ethernet0/0/2]p d v 20
[SW1-Ethernet0/0/2]un sh

//配置trunk链路
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]p l t
[SW1-Ethernet0/0/3]p t a v 10 20
[SW1-Ethernet0/0/3]un sh
Please Press ENTER.
//用户视图保存
<SW1>sav	
<SW1>save 
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:

R1路由器配置:

The device is running!
//进入形同视图
<Huawei>system-view 
//改路由器名称
[Huawei]sysname R1


//交换机可以子接口划分,直接进入子接口0.10,建议与vlan一致
[R1]int g0/0/0.10
//配置vlan封装结构,(dot1q为IEEE802.1q协议,该子接口属于vlan10)
[R1-GigabitEthernet0/0/0.10]dot1q termination  vid 10
//为该子接口添加ip地址(即vlan10下面所属主机的网关地址)
[R1-GigabitEthernet0/0/0.10]ip address 192.168.10.1 24
//	交换机可以子接口划分,直接进入子接口0.10,建议与vlan一致
[R1-GigabitEthernet0/0/0.10]int g0/0/0.20

//配置vlan封装结构,(dot1q为IEEE802.1q协议,该子接口属于vlan10)
[R1-GigabitEthernet0/0/0.20]dot1q termination  vid 20
//为改接口配置ip地址(地址是vlan20下面所属主机的网关地址)
[R1-GigabitEthernet0/0/0.20]ip add 192.168.20.1 24
//	//开启向下arp广播请求功能
[R1-GigabitEthernet0/0/0.20]ar	
[R1-GigabitEthernet0/0/0.20]arp
Jun  1 2021 11:52:34-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 7, the ch
ange loop count is 0, and the maximum number of records is 4095. b	
[R1-GigabitEthernet0/0/0.20]arp broadcast  e	
[R1-GigabitEthernet0/0/0.20]arp broadcast  enable 

//上面vlan10 的子接口配置没有广播,进入子接口进行广播
[R1-GigabitEthernet0/0/0.20]int g0/0/0.10
[R1-GigabitEthernet0/0/0.10]arp broadcast  enable 
[R1-GigabitEthernet0/0/0.10]q
[R1]q
<R1>sa	
<R1>save 
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Jun  1 2021 12:01:46-08:00 R1 %%01CFM/4/SAVE(l)[2]:The user chose Y when decidin
g whether to save the configuration to the device.

然后配置电脑ip,网关,子网掩码进行ping测试:

搞定!!

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不得不说的运维故事

你的赞是我的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值