中兴交换机三层配置

中兴交换机三层配置

目的:将1-10端口划分到3001vlan,11-20端口划分到3002vlan中去

客户端客户端IPvlan网关
主机A88.88.1.1203001192.168.1.254
主机B192.168.100.1303002192.168.100.254
1、通过Console线登录设备
      *************************************************************************
      Welcome to ZXR10 Carrier-Class High-end Routing Switch of ZTE Corporation
      *************************************************************************

ZXR10>enable		#输入enable进入特权模式,密码为:zxr10
Password:
ZXR10#configure terminal 		#进入配置模式
Enter configuration commands, one per line.  End with CTRL/Z.
ZXR10(config)#
2、创建vlan
ZXR10(config)#switchvlan-configuration     #进入vlan配置模式
ZXR10(config-swvlan)#vlan 3001				#创建3001vlan
ZXR10(config-swvlan-sub-3001)#switchport pvid gei-0/1/1/1-10    #将1-10端口划分到vlan3001


ZXR10(config)#switchvlan-configuration     #进入vlan配置模式
ZXR10(config-swvlan)#vlan 3002				#创建3002vlan
ZXR10(config-swvlan-sub-3002)#switchport pvid gei-0/1/1/11-20    #将1-10端口划分到vlan3001
3、为VLAN接口配置IPV4地址(配置vlan if)
ZXR10(config)#interface vlan3001          #进入配置 VLAN 接口                                                                       
ZXR10(config-if-vlan3001)#ip address 88.88.1.254 255.255.255.0    #配置IP地址网关
ZXR10(config-if-vlan3001)#end

ZXR10(config)#interface vlan3002                                                                                
ZXR10(config-if-vlan3002)#ip address 192.168.100.254 255.255.255.0
ZXR10(config-if-vlan3002)#end
4、保存配置
ZXR10#write  #配置完成保存设备配置
.....[OK].
5、验证测试

​ 主机B去ping主机A

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

6、常用命令
#查看某一个vlan信息	“show vlan id vlan-id”
ZXR10#show vlan id 3001
VLAN     Name     PvidPorts           UntagPorts          TagPorts          
--------------------------------------------------------------------------------
3001     vlan3001 gei-0/1/1/1-2 


#查看当前所有vlan信息  “show vlan”
ZXR10#show vlan 
VLAN     Name     PvidPorts           UntagPorts          TagPorts          
--------------------------------------------------------------------------------
1        vlan0001                                         
3001     vlan3001 gei-0/1/1/1-2                           
3002     vlan3002 gei-0/1/1/7-12                          
                  xgei-0/1/1/25-28                        
3004     vlan3004 gei-0/1/1/13-15                         
3006     vlan3006 gei-0/1/1/16-18                         
3007     vlan3007 gei-0/1/1/19-22                         
3008     vlan3008 gei-0/1/1/23-24                         
3101     vlan3101 gei-0/1/1/3-6


#删除vlan		“no vlan vlan-id”
ZXR10#configure terminal 
ZXR10(config)#switchvlan-configuration 
ZXR10(config-swvlan)#no vlan 100


#查看VLAN接口IP地址配置 	"show ip interface vlan-id"
ZXR10#show ip interface vlan3001
vlan3001 AdminStatus is up, PhyStatus is up, line protocol is up, IPv4 protocol 
is up
  Internet address is 88.88.1.254/24 
  Broadcast address is 255.255.255.255
  Address determined by setup command 
  Load-sharing bandwidth 1000000 Kbps
  IP MTU 1500 bytes
  
 #删除vlan的IP地址	“no ip address IP/24”
 ZXR10#configure terminal 
ZXR10(config)#interface  vlan100
ZXR10(config-if-vlan100)#no ip address 192.168.100.254/24


#修改端口模式为将端口xgei-1/1/1/1设置为trunk模式,允许vlan 11-19和vlan 30通过
ZXR10#configure terminal 
ZXR10(config)#switchvlan-configuration 
ZXR10(config-swvlan)#interface xgei-1/1/1/1 
ZXR10(config-swvlan-if-xgei-1/1/1/1)#switchport mode trunk
ZXR10(config-swvlan-if-xgei-1/1/1/1)#switchport trunk vlan 11-19,30
ZXR10(config-swvlan-if-xgei-1/1/1/1)#exit
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

枯木逢秋࿐

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值