vlan2:192.168.1.0/24
vlan3:192.168.2.0/24
使用DHCP,实现全网可达。
第一步、创建vlan
[LSW1]vlan batch 2 to 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]vlan batch 2 to 3
Info: This operation may take a few seconds. Please wait for a moment...done.
第二步、划分接口到vlan
[LSW1]interface e0/0/1
[LSW1-Ethernet0/0/1]port link-type access
[LSW1-Ethernet0/0/1]port default vlan 2
[LSW1]interface e0/0/2
[LSW1-Ethernet0/0/2]port link-type access
[LSW1-Ethernet0/0/2]port default vlan 2
[LSW1]interface e0/0/3
[LSW1-Ethernet0/0/3]port link-type access
[LSW1-Ethernet0/0/3]port default vlan 3
[LSW1]interface e0/0/4
[LSW1-Ethernet0/0/4]port link-type access
[LSW1-Ethernet0/0/4]port default vlan 3
[LSW2]interface e0/0/1
[LSW2-Ethernet0/0/1]port link-type access
[LSW2-Ethernet0/0/1]port default vlan 2
[LSW2]interface e0/0/2
[LSW2-Ethernet0/0/2]port link-type access
[LSW2-Ethernet0/0/2]port default vlan 2
[LSW2]interface e0/0/3
[LSW2-Ethernet0/0/3]port link-type access
[LSW2-Ethernet0/0/3]port default vlan 3
[LSW2]interface e0/0/4
[LSW2-Ethernet0/0/4]port link-type access
[LSW2-Ethernet0/0/4]port default vlan 3
第三步、修改trunk干道
[LSW1]interface e0/0/5
[LSW1-Ethernet0/0/5]port link-type trunk
[LSW1-Ethernet0/0/5]port trunk allow-pass vlan all
[LSW2]interface e0/0/5
[LSW2-Ethernet0/0/5]port link-type trunk
[LSW2-Ethernet0/0/5]port trunk allow-pass vlan all
第四步、修改路由器和交换机之间的接口
[LSW1]interface e0/0/6
[LSW1-Ethernet0/0/6]port link-type trunk
[LSW1-Ethernet0/0/6]port trunk allow-pass vlan all
[AR1]interface g0/0/0.1
[AR1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[AR1-GigabitEthernet0/0/0.1]ip address 192.168.1.254 24
[AR1-GigabitEthernet0/0/0.1]arp broadcast enable
[AR1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[AR1]ip pool a
[AR1-ip-pool-a]network 192.168.1.0 mask 24
[AR1-ip-pool-a]gateway-list 192.168.1.254
[AR1-ip-pool-a]q
[AR1]interface g0/0/0.1
[AR1-GigabitEthernet0/0/0.1]dhcp select global
[AR1]interface g0/0/0.2
[AR1-GigabitEthernet0/0/0.2]dot1q termination vid 3
[AR1-GigabitEthernet0/0/0.2]ip address 192.168.2.254 24
[AR1-GigabitEthernet0/0/0.2]arp broadcast enable
[AR1]ip pool b
Info: It's successful to create an IP address pool.
[AR1-ip-pool-b]network 192.168.2.0 mask 24
[AR1-ip-pool-b]gateway-list 192.168.2.254
[AR1-ip-pool-b]q
[AR1]interface g0/0/0.2
[AR1-GigabitEthernet0/0/0.2]dhcp select global
实验完成