最佳答案
配置步骤
#配置虚接口地址
<H3C>system-view
[H3C]interface Vlan-interface 1
[H3C-Vlan-interface1]ip address 192.168.1.1 24
[H3C-Vlan-interface1]quit
#添加两条静态路由
[H3C]ip route-static 192.168.2.0 24 192.168.1.254
[H3C]ip route-static 192.168.3.0 24 192.168.1.254
#保存配置
[H3C]save force
#创建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
#将连接PC1和PC2接口划分到相应的vlan中
[H3C]interface GigabitEthernet 1/0/2
[H3C-GigabitEthernet1/0/2] port access vlan 2
[H3C-GigabitEthernet1/0/2]interface GigabitEthernet 1/0/3
[H3C-GigabitEthernet1/0/3] port access vlan 3
#添加静态路由,指向路由器的网关
[H3C]ip route-static 0.0.0.0 0 192.168.1.1
#保存配置
[H3C]save force
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论