hybrid应用和单臂路由技术
一、hybrid(混合端口)
1、启动设备,设置PC3、PC4的IP地址和子网掩码;Client1、Client2、Server1的IP地址
2、设置SW2参数
<Huawei>undo terminal monitor 关闭弹窗
<Huawei>system-view 进入系统试图
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0 永不超时
[Huawei-ui-console0]sysname SW2 更改名称
[SW2]Vlan batch 10 20 100 设置vlan 10 20 100
[SW2]Int e0/0/1 进入e0/0/1接口
[SW2-Ethernet0/0/1]Port hybrid pvid vlan 10 打上vlan10 标签
[SW2-Ethernet0/0/1]Port hybrid untagged vlan 10 100 解除vlan 10 100 标签
[SW2-Ethernet0/0/1]Int e0/0/2 进入e0/0/2接口
[SW2-Ethernet0/0/2]Port hybrid pvid vlan 20 打上vlan20 标签
[SW2-Ethernet0/0/2]Port hybrid untagged vlan 20 100 解除vlan 20 100 标签
[SW2-Ethernet0/0/2]Int g0/0/1 进入g0/0/1接口
[SW2-GigabitEthernet0/0/1]Port link-type trunk 接口类型为trunk
[SW2-GigabitEthernet0/0/1]Port trunk allow-pass vlan 10 20 100 允许vlan10 20 100 通过
[SW2-GigabitEthernet0/0/1]quit 退出
3、设置SW3参数
<Huawei>Undo terminal monitor
<Huawei>System-view
[Huawei]User-interface console 0
[Huawei-ui-console0]Idle-timeout 0 0
[Huawei-ui-console0]Sysname SW3
[SW3]Vlan batch 10 20 100
[SW3]Int e0/0/1
[SW3-Ethernet0/0/1]Port hybrid pvid vlan 10
[SW3-Ethernet0/0/1]Port hybrid untagged vlan 10 100
[SW3-Ethernet0/0/1]Int e0/0/2
[SW3-Ethernet0/0/2]Port hybrid pvid vlan 20
[SW3-Ethernet0/0/2Port hybrid untagged vlan 20 100
[SW3-Ethernet0/0/2]Int g0/0/1
[SW3-GigabitEthernet0/0/1]Port link-type trunk
[SW3-GigabitEthernet0/0/1]Port trunk allow-pass vlan 10 20 100
[SW3-GigabitEthernet0/0/1]Int g0/0/2
[SW3-GigabitEthernet0/0/2]Port hybrid pvid vlan 100
[SW3-GigabitEthernet0/0/2]Port hybrid untagged vlan 10 20 100
[SW3-GigabitEthernet0/0/2]Quit
4、打开Server1→服务器信息→FtpServer→选择文件根目录后启动→打开Client1
→客户端信息→输入服务器地址→登录
相同vlan间通信,所有PC能访问Server1服务器
二、单臂路由(不同vlan间路由)
1、启动设备,设置PC5、PC6的IP地址、子网掩码和网关(两PC不同网段、同一PC的IP地址与网关的网段保持一致)
2、设置SW6参数
<Huawei>Undo terminal monitor
<Huawei>System-view
[Huawei]User-interface console 0
[Huawei-ui-console0]Idle-timeout 0 0
[Huawei-ui-console0]Sysname SW6
[SW6]Vlan batch 2 3
[SW6]Int e0/0/1
[SW6-Ethernet0/0/1]Port hybrid pvid vlan 2
[SW6-Ethernet0/0/1]Port hybrid untagged vlan 2
[SW6-Ethernet0/0/1]Int e0/0/2
[SW6-Ethernet0/0/2]Port hybrid pvid vlan 3
[SW6-Ethernet0/0/2]Port hybrid untagged vlan 3
[SW6-Ethernet0/0/2]Int g0/0/1
[SW6-GigabitEthernet0/0/1]Port link-type trunk
[SW6-GigabitEthernet0/0/1]Port trunk allow-pass vlan 2 3
[SW6-GigabitEthernet0/0/1]quit
3、设置R1参数
<Huawei>Undo terminal monitor
<Huawei>System-view
[Huawei]User-interface console 0
[Huawei-ui-console0]Idle-timeout 0 0
[Huawei-ui-console0]Sysname R4
[R4]Int g0/0/0
[R4-GigabitEthernet0/0/0]Undo shundown 开启
[R4-GigabitEthernet0/0/0]Int g0/0/0.1 进入g0/0/0.1接口
[R4-GigabitEthernet0/0/0.1]Vlan-type dot1q 2 default vlan2 为802.1q
[R4-GigabitEthernet0/0/0.1]Ip add 192.168.1.1 24 设置IP为192.168.1.1 24
[R4-GigabitEthernet0/0/0.1]Int g0/0/0.2
[R4-GigabitEthernet0/0/0.2]Vlan-type dot1q 3 default
[R4-GigabitEthernet0/0/0.2]Ip add 192.168.2.1 24
[R4-GigabitEthernet0/0/0.2]quit
4、利用PC去ping另一个PC的IP,不同网段间pc通信