终端直连三层网关设备进行通信

 时间:2026-02-12 06:52:11

1、配置思路 :此场景配置简单,只需将连接 PC 的接口加入 VLAN,然后创建 VLANIF,并配置 IP 地址为对应用户的网关即可。

终端直连三层网关设备进行通信

2、创建 vlan<SW1> system-view                            //进入系统模式

[SW1] vlan batch 10 20                                      //批量新建 vlan 10 和 20

[Huawei]dis vlan                                                //查看建立vlan

终端直连三层网关设备进行通信

3、创建 vlanif 三层接口作为 PC 电脑的网关 IP 地址

[SW1] interface Vlanif 10                            //进入三层 vlanif10 接口

[SW1-Vlanif10] ip address 10.1.1.1 255.255.255.0

                                                                  //此 IP 地址为 PC1 对应网关地址

[SW1-Vlanif10] quit                                  //退出 vlanif2 接口

[SW1] interface Vlanif 20

[SW1-Vlanif20] ip address 10.1.2.1 255.255.255.0

                                                                  //此 IP 地址为 PC2 对应网关地址[SW1-Vlanif20] quit

终端直连三层网关设备进行通信

4、接口加入相应 vlan

[SW1] interface GigabitEthernet 0/0/1

[SW1-GigabitEthernet0/0/1] port link-type access //链路类型为 access

[SW1-GigabitEthernet0/0/1] port default vlan 10

                                                                          //将 PC1 划分到 VLAN 10 中

[SW1-GigabitEthernet0/0/1] quit

[SW1] interface GigabitEthernet 0/0/2

[SW1-GigabitEthernet0/0/2] port link-type access     //链路类型为 access

[SW1-GigabitEthernet0/0/2] port default vlan 20

                                                                          //将 PC2 划分到 VLAN 10 中

[SW1-GigabitEthernet0/0/2] quit

[Huawei]quit

<Huawei>save

终端直连三层网关设备进行通信

终端直连三层网关设备进行通信

5、验证一下用PC2ping一下PC1的地址看看

终端直连三层网关设备进行通信

  • 如何更新或安装VMTools
  • windows下iconv安装并使用
  • 使用PHP下载APK文件
  • 谷歌浏览器提示
  • cmd怎么打开本地服务设置
  • 热门搜索
    什么是防卫过当 letter是什么意思 买车需要什么手续 镇江有什么好玩的地方 搞基是什么意思 pet是什么意思 year是什么意思 开黑是什么意思 造化弄人什么意思 此致敬礼什么意思