pc1:192.168.1.1
网关:192.168.1.254
子网掩码:255.255.255.0
pc2:192.168.1.2
网关:192.168.1.254
子网掩码:255.255.255.0
pc3:192.168.2.1
网关:192.168.2.254
子网掩码:255.255.255.0
pc1:192.168.2.2
网关:192.168.2.254
子网掩码:255.255.255.0
sw1:
interface Ethernet0/0/1
port link-type access
port default vlan 10
interface Ethernet0/0/2
port link-type access
port default vlan 10
interface Ethernet0/0/3
port link-type access
port default vlan 20
interface Ethernet0/0/4
port link-type access
port default vlan 20
interface Ethernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 4094
R1:
interface GigabitEthernet0/0/0.1
dot1q termination vid 10 识别vlan10的流量
ip address 192.168.1.254 255.255.255.0
arp broadcast enable ( arp广播启用)
interface GigabitEthernet0/0/0.2
dot1q termination vid 20 识别vlan 20的流量
ip address 192.168.2.254 255.255.255.0
arp broadcast enable ( arp广播启用)