1.实验需求
全网可达;使用DHCP获取IP地址;
2.实验思路
1.配置交换机,创建vlan;更换交换机的接口链路类型配置trunk干道,放通vlan
2.配置路由器;配置子接口;配置在子接口下方DHCP服务
3、实验步骤
1.配置vlan
2. 更换交换机的接口链路类型配置trunk干道,放通vlan
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 2
[sw1]int e0/0/3
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 3
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type trunk
[sw1-Ethernet0/0/1]port trunk allow-pass vlan 2 3
[sw2]int e0/0/3
[sw2-Ethernet0/0/3]port link-type access
[sw2-Ethernet0/0/3]port default vlan 2
[sw2]int e0/0/4
[sw2-Ethernet0/0/4]port link-type access
[sw2-Ethernet0/0/4]port default vlan 3
[sw2-Ethernet0/0/2]port link-type trunk
[sw2-Ethernet0/0/2]port trunk allow-pass vlan 2 3
[sw2]int e0/0/1
[sw2-Ethernet0/0/1]port link-type trunk
[sw2-Ethernet0/0/1]port trunk allow-pass vlan 2 3
[sw3]int e0/0/2
[sw3-Ethernet0/0/2]port link-type access
[sw3-Ethernet0/0/2]port default vlan 2
[sw3]int e0/0/3
[sw3-Ethernet0/0/3]port link-type access
[sw3-Ethernet0/0/3]port default vlan 3
[sw3-Ethernet0/0/2]int e0/0/1
[sw3-Ethernet0/0/1]port link-type trunk
[sw3-Ethernet0/0/1]port trunk allow-pass vlan 2 3
2.配置路由器;配置子接口;配置在子接口下方DHCP服务
[R1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.2]dot1q termination vid 2
[R1-GigabitEthernet0/0/0.2]arp broadcast enable
[R1]int g0/0/0.3
[R1-GigabitEthernet0/0/0.3]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/0.3]dot1q termination vid 3
[R1-GigabitEthernet0/0/0.3]arp broadcast enable
[R1]int g0/0/1.2
[R1-GigabitEthernet0/0/1.2]ip add 192.168.3.254 24
[R1-GigabitEthernet0/0/1.2]dot1q termination vid 2
[R1-GigabitEthernet0/0/1.2]arp broadcast enable
[R1]int g0/0/1.3
[R1-GigabitEthernet0/0/1.3]ip add 192.168.4.254 24
[R1-GigabitEthernet0/0/1.3]dot1q termination vid 3
[R1-GigabitEthernet0/0/1.3]arp broadcast enable
3.全网可达,使用DHCP获取IP地址