如何在单个端口上配置2个vlan,计算机上更改IP地址就可以访问不同的地址段。谢谢!
(0)
最佳答案
具体配置命令?
端口下还有其他多个终端,一改vlan,其他终端网络不通。我的终端通过改动IP实现不同地址段的网络连接。
(0)
# vlan 2 ip-subnet-vlan 1 ip 192.168.1.0 255.255.255.0 # vlan 3 ip-subnet-vlan 1 ip 192.168.2.0 255.255.255.0 # interface NULL0 # interface Vlan-interface2 ip address 192.168.1.1 255.255.255.0 # interface Vlan-interface3 ip address 192.168.2.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid undo port hybrid vlan 1 port hybrid vlan 2 to 3 untagged port hybrid ip-subnet-vlan vlan 2 port hybrid ip-subnet-vlan vlan 3 # interface GigabitEthernet1/0/2 #
如果你网卡支持dot1q或许可以,或者做基于子网的vlan划分
(0)
# vlan 2 ip-subnet-vlan 1 ip 192.168.1.0 255.255.255.0 # vlan 3 ip-subnet-vlan 1 ip 192.168.2.0 255.255.255.0 # interface NULL0 # interface Vlan-interface2 ip address 192.168.1.1 255.255.255.0 # interface Vlan-interface3 ip address 192.168.2.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid undo port hybrid vlan 1 port hybrid vlan 2 to 3 untagged port hybrid ip-subnet-vlan vlan 2 port hybrid ip-subnet-vlan vlan 3 # interface GigabitEthernet1/0/2 #
# vlan 2 ip-subnet-vlan 1 ip 192.168.1.0 255.255.255.0 # vlan 3 ip-subnet-vlan 1 ip 192.168.2.0 255.255.255.0 # interface NULL0 # interface Vlan-interface2 ip address 192.168.1.1 255.255.255.0 # interface Vlan-interface3 ip address 192.168.2.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid undo port hybrid vlan 1 port hybrid vlan 2 to 3 untagged port hybrid ip-subnet-vlan vlan 2 port hybrid ip-subnet-vlan vlan 3 # interface GigabitEthernet1/0/2 #
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
# vlan 2 ip-subnet-vlan 1 ip 192.168.1.0 255.255.255.0 # vlan 3 ip-subnet-vlan 1 ip 192.168.2.0 255.255.255.0 # interface NULL0 # interface Vlan-interface2 ip address 192.168.1.1 255.255.255.0 # interface Vlan-interface3 ip address 192.168.2.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid undo port hybrid vlan 1 port hybrid vlan 2 to 3 untagged port hybrid ip-subnet-vlan vlan 2 port hybrid ip-subnet-vlan vlan 3 # interface GigabitEthernet1/0/2 #