一、拓扑图及需求
二、需求分析
1、交换的配置----VLAN
2、实现设备的ip配置------路由器、pc等
三、配置过程
1、交换的配置----VLAN
示例:LSW1
[sw1]vlan batch 2 3
[sw1]int g 0/0/3
[sw1-GigabitEthernet0/0/3]port link-type access
[sw1-GigabitEthernet0/0/3]port discar v
[sw1-GigabitEthernet0/0/3]port default vlan 2
[sw1-GigabitEthernet0/0/4]port li ac
[sw1-GigabitEthernet0/0/4]po d v 3
[sw1]int g 0/0/2
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 3
[sw1-GigabitEthernet0/0/2]int g 0/0/1
[sw1-GigabitEthernet0/0/1]po t all v 2 3
2、实现设备的ip配置------路由器、pc等
[r1]dhcp enable
[r1]ip pool vlan2
[r1-ip-pool-vlan2]network 192.168.2.0 mask 24
[r1-ip-pool-vlan2]gateway-list 192.168.2.254
[r1-ip-pool-vlan2]dns-list 8.8.8.8[r1]ip pool vlan3
[r1-ip-pool-vlan3]network 192.168.3.0 mask 24
[r1-ip-pool-vlan3]gateway-list 192.168.3.254
[r1-ip-pool-vlan3]dns 8.8.8.8
[r1-GigabitEthernet0/0/0.1]ip add 192.168.2.254 24
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1]int GigabitEthernet 0/0/0.2
[r1-GigabitEthernet0/0/0.2]ip add 192.168.3.254 24[r1-GigabitEthernet0/0/0.2]dot1q termination vid 3
[r1-GigabitEthernet0/0/0.2]arp broadcast enable
[r1-GigabitEthernet0/0/0.2]dhcp s g