实验目的:实现不同网段之间的通信。
拓扑图:
配置文件:
SW1配置
#
sysname sw1
#
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配置
#
interface GigabitEthernet0/0/0.1
vlan-type dot1q 10 default
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/0.2
vlan-type dot1q 20 default
ip address 192.168.2.1 255.255.255.0