1.规划IP地址
2.创建VLAN
[sw1]vlan 2 [sw1]vlan 3 [sw2]vlan 2 [sw2]vlan 3 [sw3]vlan 2 [sw3]vlan 3
3.将交换机上的各个接口划分到对应的VLAN中
[sw1]interface e0/0/1 [sw1-Ethernet0/0/1]port link-type access? [sw1-Ethernet0/0/1]port default vlan 2
[sw1]interface e0/0/3 [sw1-Ethernet0/0/3]port link-type access? [sw1-Ethernet0/0/3]port default vlan 3
[sw2]interface e0/0/1 [sw2-Ethernet0/0/1]port link-type access? [sw2-Ethernet0/0/1]port default vlan 2
[sw2]interface e0/0/2 [sw2-Ethernet0/0/2]port link-type access? [sw2-Ethernet0/0/2]port default vlan 3
[sw3]interface e0/0/1 [sw3-Ethernet0/0/1]port link-type access? [sw3-Ethernet0/0/1]port default vlan 2
[sw3]interface e0/0/2 [sw3-Ethernet0/0/2]port link-type access? [sw3-Ethernet0/0/2]port default vlan 3
3.配置trunk干道
[sw1]int e0/0/2 [sw1-Ethernet0/0/2]port link-type trunk? [sw1-Ethernet0/0/2]port trunk allow-pass vlan 2 to 3 [sw2]port-group group-member e0/0/3 g0/0/1 [sw2-port-group]port link-type trunk [sw2-port-group]port trunk allow-pass vlan 2 to 3 [sw3]int g0/0/1 [sw3-GigabitEthernet0/0/1]port link-type trunk [sw3-GigabitEthernet0/0/1]port trunk?allow-pass vlan all
4.配置子接口
[r1]int g0/0/0.1 [r1-GigabitEthernet0/0/0.1]dot1q termination vid 2 [r1-GigabitEthernet0/0/0.1]ip add 192.168.1.1 25 [r1-GigabitEthernet0/0/0.1]arp broadcast enable? [r1]int g0/0/0.2 [r1-GigabitEthernet0/0/0.2]dot1q termination vid 3 [r1-GigabitEthernet0/0/0.2]ip add 192.168.1.129?25 [r1-GigabitEthernet0/0/0.2]arp broadcast enable?
[r2]int g0/0/1.1 [r2-GigabitEthernet0/0/1.1]dot1q termination vid 2 [r2-GigabitEthernet0/0/1.1]ip add 192.168.2.1 25 [r2-GigabitEthernet0/0/1.1]arp broadcast enable? [r2]int g0/0/1.2 [r2-GigabitEthernet0/0/1.2]dot1q termination vid 3 [r2-GigabitEthernet0/0/1.2]ip add 192.168.2.129 25 [r2-GigabitEthernet0/0/1.2]arp broadcast enable
5.配置DHCP服务,创建池塘
[r1]dhcp enable? [r1]ip pool v2 [r1-ip-pool-v2]network 192.168.1.0 mask 25 [r1-ip-pool-v2]gateway-list 192.168.1.1 [r1-ip-pool-v2]dns-list 114.114.114.114 8.8.8.8 [r1]int g0/0/0.1 [r1-GigabitEthernet0/0/0.1]dhcp select global? [r1]ip pool v3 [r1-ip-pool-v3]network 192.168.1.128 mask 25 [r1-ip-pool-v3]gateway-list 192.168.1.129 [r1-ip-pool-v3]dns-list 114.114.114.114 8.8.8.8 [r1]int g0/0/0.2 [r1-GigabitEthernet0/0/0.2]dhcp select global
[r2]dhcp enable? [r2]ip pool v2 [r2-ip-pool-v2]network 192.168.2.0 mask 25 [r2-ip-pool-v2]gateway-list 192.168.2.1 [r2-ip-pool-v2]dns-list 114.114.114.114 8.8.8.8 [r2]int g0/0/1.1 [r2-GigabitEthernet0/0/1.1]dhcp select global? [r2]ip pool v3 [r2-ip-pool-v3]network 192.168.2.128 mask 25 [r2-ip-pool-v3]gateway-list 192.168.2.129 [r2-ip-pool-v3]dns-list 114.114.114.114 8.8.8.8 [r2]int g0/0/1.2 [r2-GigabitEthernet0/0/1.2]dhcp select global
(测试)
?
6.配置R1到R2之间的路由器IP地址
[r1]int g0/0/1 [r1-GigabitEthernet0/0/1]ip add 192.168.3.1 24
7.配置R1和R2之间的静态路由
[r1]ip route-static 192.168.2.0 24 192.168.3.2 [r2]ip route-static 192.168.1.0 24 192.168.3.1
8.测试是否通路
|