不同vlan间相互通信
单臂路由拓扑图步骤LSW1配置R1配置PC配置测试结果
三层交换技术拓扑图LSW1配置LSW2配置PC配置测试结果
三层交换技术——直接连接三层交换机拓扑图LSW1配置PC配置测试结果
单臂路由
拓扑图
R1型号:Router LSW1型号:S3700
步骤
LSW1配置
#
vlan batch 10 20
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
R1配置
#
int g0/0/0
undo shutdown
#
interface GigabitEthernet0/0/0.1
vlan-type dot1q 10
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/0.2
vlan-type dot1q 20
ip address 192.168.2.1 255.255.0.0
PC配置
PCIP地址子网掩码网关
PC1192.168.1.10255.255.255.0192.168.1.1PC2192.168.2.10255.255.255.0192.168.2.1
测试结果
三层交换技术
拓扑图
LSW1型号:S5700 LSW2型号:S3700 LSW1和LSW2两台交换机可以合并成一个,把LSW2的操作全部放到LSW1上面。
LSW1配置
#
vlan batch 10 20
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
LSW2配置
#
vlan batch 10 20
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
PC配置
PCIP地址子网掩码网关
PC1192.168.1.10255.255.255.0192.168.1.1PC2192.168.2.10255.255.255.0192.168.2.1
测试结果
三层交换技术——直接连接三层交换机
拓扑图
LSW1配置
#
vlan batch 10 20
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
PC配置
PCIP地址子网掩码网关
PC1192.168.1.10255.255.255.0192.168.1.1PC2192.168.2.10255.255.255.0192.168.2.1
测试结果