将et47和et48配置成上联口,现在需要这3个vlan之间可以互相访问,并且都能通过上联口上网。注:上联口的地址是通过路由器分配的。。。
(0)
(0)
#创建vlan
<H3C>system-view
[H3C]vlan 2 to 3
#创建虚接口地址,vlan2和vlan3的地址分别作为PC1和PC2的网关
[H3C]interface vlan 1
[H3C-Vlan-interface1]ip address 192.168.1.254 24
[H3C]interface vlan 2
[H3C-Vlan-interface2]ip address 192.168.2.1 24
[H3C]interface vlan 3
[H3C-Vlan-interface3]ip address 192.168.3.1 24
[H3C]interface vlan 10
[H3C-Vlan-interface3]ip address dhcp
#将连接PC1和PC2接口划分到相应的vlan中
[H3C]interface GigabitEthernet 1/0/3
[H3C-GigabitEthernet1/0/3] port access vlan 2
[H3C-GigabitEthernet1/0/4]interface GigabitEthernet 1/0/4
[H3C-GigabitEthernet1/0/4] port access vlan 2
[H3C]interface GigabitEthernet 1/0/5
[H3C-GigabitEthernet1/0/5] port access vlan 3
[H3C-GigabitEthernet1/0/6]interface GigabitEthernet 1/0/6
[H3C-GigabitEthernet1/0/6] port access vlan 3
[H3C]interface GigabitEthernet 1/0/47
[H3C-GigabitEthernet 1/0/47 ] port access vlan 10
[H3C-GigabitEthernet 1/0/48 ]interface GigabitEthernet 1/0/48
[H3C-GigabitEthernet 1/0/48 ] port access vlan 10
#添加静态路由,指向路由器的网关
[H3C]ip route-static 0.0.0.0 0 192.168.1.1 //192.168.1.1只是举例,实际应该写上连路由器的互联地址
#保存配置
[H3C]save force
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论