子网划分
配置vlan
sw1
[sw1]vlan batch 2 to 3
[sw1]interface Ethernet0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 2
[sw1]interface Ethernet0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 3
[sw1]interface e0/0/3
[sw1-Ethernet0/0/3]port link-type trunk
[sw1-Ethernet0/0/3]port trunk allow-pass vlan 2 to 3
[sw1]interface e0/0/4
[sw1-Ethernet0/0/4]port link-type trunk
[sw1-Ethernet0/0/4]port trunk allow-pass vlan 2 to 3
sw2
[sw2]interface Ethernet0/0/1
[sw2-Ethernet0/0/1]port link-type access
[sw2-Ethernet0/0/1]port default vlan 2
[sw2]interface Ethernet0/0/2
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port default vlan 3
配置路由器子接口并开启dhcp
[r2]int g0/0/2.1
[r2-GigabitEthernet0/0/2.1]ip ad 192.168.1.1 29
[r2-GigabitEthernet0/0/2.1]dot1q termination vid 2
[r2-GigabitEthernet0/0/2.1]arp broadcast enable
[r2-GigabitEthernet0/0/2.1]int g0/0/2.2
[r2-GigabitEthernet0/0/2.2]ip ad 192.168.1.9 29
[r2-GigabitEthernet0/0/2.2]dot1q termination vid 3
[r2-GigabitEthernet0/0/2.2]arp broadcast enable
[r2-GigabitEthernet0/0/2.2]q
[r2]dhcp enable
[r2]ip pool v2
Info: It's successful to create an IP address pool.
[r2-ip-pool-v2]network 192.168.1.0 mask 29
[r2-ip-pool-v2]gateway-list 192.168.1.1
[r2-ip-pool-v2]dns-list 8.8.8.8
[r2-ip-pool-v2]ip pool v3
Info: It's successful to create an IP address pool.
[r2-ip-pool-v3]network 192.168.1.8 mask 29
[r2-ip-pool-v3]gateway-list 192.168.1.9
[r2-ip-pool-v3]dns-list 8.8.8.8
[r2-ip-pool-v3]int g0/0/2.1
[r2-GigabitEthernet0/0/2.1]dhcp select global
[r2-GigabitEthernet0/0/2.1]int g0/0/2.2
[r2-GigabitEthernet0/0/2.2]dhcp select global
配置路由器
r1
[r1]ip route-static 0.0.0.0 0 192.168.1.37
[r1]ip route-static 0.0.0.0 0 192.168.1.26
[r1]ip route-static 192.168.1.0 28 192.168.1.26
[r1]ip route-static 192.168.1.28 30 192.168.1.26
[r1]ip route-static 192.168.1.32 30 192.168.1.37
[r1]ip route-static 192.168.1.40 30 192.168.1.37
[r1]ip route-static 192.168.1.40 30 192.168.1.26
[r1]ip route-static 192.168.1.44 30 192.168.1.26 pre 61
[r1]ip route-static 192.168.1.44 30 192.168.1.37 pre 61
[r1]ip route-static 100.1.1.0 24 192.168.1.37
[r1]ip route-static 100.1.1.0 24 192.168.1.26
[r1]ip route-static 192.168.1.0 25 NULL 0
r2
[r2]ip route-static 0.0.0.0 0 192.168.1.30
[r2]ip route-static 192.168.1.0 28 NULL 0
[r2]ip route-static 192.168.1.32 30 192.168.1.30
[r2]ip route-static 192.168.1.36 30 192.168.1.25
[r2]ip route-static 192.168.1.0 25 192.168.1.25
[r2]ip route-static 192.168.1.40 30 192.168.1.30
[r2]ip route-static 192.168.1.44 30 192.168.1.30 pre 61
[r2]ip route-static 100.1.1.0 24 192.168.1.30
r3
[r3]ip route-static 0.0.0.0 0 192.168.1.42
[r3]ip route-static 0.0.0.0 0 192.168.1.46 pre 61
[r3]ip route-static 100.1.1.0 24 192.168.1.42
[r3]ip route-static 100.1.1.0 24 192.168.1.46 pre 61
[r3]ip route-static 192.168.1.36 30 192.168.1.34
[r3]ip route-static 192.168.1.24 30 192.168.1.29
[r3]ip route-static 192.168.1.0 28 192.168.1.29
[r3]ip route-static 192.168.1.0 25 192.168.1.29
[r3]ip route-static 192.168.1.0 25 192.168.1.34
[r3]ip route-static 192.168.1.0 26 NULL 0
r4
[r4]ip route-static 0.0.0.0 0 192.168.1.33
[r4]ip route-static 192.168.1.40 30 192.168.1.33
[r4]ip route-static 192.168.1.44 30 192.168.1.33 pre 61
[r4]ip route-static 100.1.1.0 24 192.168.1.33
[r4]ip route-static 192.168.1.0 25 192.168.1.38
[r4]ip route-static 192.168.1.0 28 192.168.1.38
[r4]ip route-static 192.168.1.0 28 192.168.1.33
[r4]ip route-static 192.168.1.24 30 192.168.1.38
[r4]ip route-static 192.168.1.28 30 192.168.1.33
r5
[r5]ip route-static 0.0.0.0 0 100.1.1.2
[r5]ip route-static 192.168.1.0 26 192.168.1.41
[r5]ip route-static 192.168.1.0 26 192.168.1.45 pre 61
[r5]ip route-static 192.168.1.0 25 192.168.1.41
[r5]ip route-static 192.168.1.0 25 192.168.1.45 pre 61
[r5]ip route-static 192.168.1.0 28 192.168.1.41
[r5]ip route-static 192.168.1.0 28 192.168.1.45 pre 61
isp
ip route-static 192.168.1.0 24 100.1.1.1
ping
pc4
pc1