一,实验拓扑
二,实验需求
1,全网可达
2,使用DHCP获得IP地址
三,实验思路
1,配置交换机
(1.创建VLAN
(2.更改交换机的接口链路类型
(3.配置trunk干道,放通VLAN
2,配置路由器
(1.配置子接口
(2.配置DHCP服务
(3.在子接口下放DHCP服务
四,实验步骤
1,配置交换机
LSW1
[LSW1]VLAN 2
[LSW1-vlan2]quit
[LSW1]VLAN 3
[LSW1-vlan3]
[LSW1]INT E0/0/2
[LSW1-Ethernet0/0/2]port link-type access
[LSW1-Ethernet0/0/2]port default vlan 2
[LSW1]int e0/0/3
[LSW1-Ethernet0/0/3]port link-type access
[LSW1-Ethernet0/0/3]
[LSW1-Ethernet0/0/3]
[LSW1-Ethernet0/0/3]port default vlan 3
[LSW1]int e0/0/1
[LSW1-Ethernet0/0/1]port link-type trunk
[LSW1-Ethernet0/0/1]port trunk allow-pass vlan 2 3
LSW2
[LSW2]int e0/0/3
[LSW2-Ethernet0/0/3]port link-type access
[LSW2-Ethernet0/0/3]
[LSW2-Ethernet0/0/3]port default vlan 2
[LSW2]int e0/0/4
[LSW2-Ethernet0/0/4]port link-type access
[LSW2-Ethernet0/0/4]port default vlan 3
[LSW2]int e0/0/2
[LSW2-Ethernet0/0/2]port link-type trunk
[LSW2-Ethernet0/0/2]port trunk allow-pass vlan 2 3
LSW3
[LWS3]vlan 2
[LWS3-vlan2]qu
[LWS3]vlan 3
[LWS3-vlan3]
[LWS3]int e0/0/3
[LWS3-Ethernet0/0/3]port link-type access
[LWS3-Ethernet0/0/3]port default vlan 3
[LWS3-Ethernet0/0/3]
[LWS3-Ethernet0/0/3]qu
[LWS3]int e0/0/1
[LWS3-Ethernet0/0/1]port link-type trunk
[LWS3-Ethernet0/0/1]port trunk allow-pass vlan 2 3
2,配置路由
[R1]INT G0/0/0.2
[R1-GigabitEthernet0/0/0.2]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.2]
[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]
[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
DSHP地址
[R1]ip pool aa
[R1-ip-pool-aa]network 192.168.1.0 mask 24
[R1-ip-pool-aa]
[R1-ip-pool-aa]ga
[R1-ip-pool-aa]gateway-list 192.168.1.254
[R1-ip-pool-aa]dns
[R1-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[R1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]dhcp select global
[R1-GigabitEthernet0/0/0.2]
[R1-GigabitEthernet0/0/0.2]qu
[R1]ip pool bb
[R1-ip-pool-bb]netw
[R1-ip-pool-bb]network 192.168.2.0 mask 24
[R1-ip-pool-bb]ga
[R1-ip-pool-bb]gateway-list 192.168.2.254
[R1-ip-pool-bb]
[R1-ip-pool-bb]dns
[R1-ip-pool-bb]dns-list 8.8.8.8 114.114.114.114
[R1-ip-pool-bb]
[R1-ip-pool-bb]qu
[R1]int g0/0/0.3
[R1-GigabitEthernet0/0/0.3]dhcp se
[R1-GigabitEthernet0/0/0.3]dhcp select g
[R1]ip pool cc
[R1-ip-pool-cc]ne
[R1-ip-pool-cc]netw
[R1-ip-pool-cc]network 192.168.3.0 mask 24
[R1-ip-pool-cc]gateway-list 192.168.3.254
[R1-ip-pool-cc]dns-list 8.8.8.8 114.114.114.114
[R1]int g0/0/1.2
[R1-GigabitEthernet0/0/1.2]dhcp select global
[R1]ip pool dd
[R1-ip-pool-dd]network 192.168.4.0 mask 24
[R1-ip-pool-dd]
[R1-ip-pool-dd]gateway-list 192.168.4.254
[R1-ip-pool-dd]
[R1-ip-pool-dd]dns
[R1-ip-pool-dd]dns-list 8.8.8.8 114.114.114.114
[R1-ip-pool-dd]qu
[R1]int g0/0/1.3
[R1-GigabitEthernet0/0/1.3]dhcp select global