一、实验拓扑:
1-交换通信:单臂路由实验+DHCP_第1张图片
二、实验要求:
1、R1部署单臂路由技术,为实现不同vlan间的通信:f0/0配置子接口f0/0.10、f0/0.20,封装dot1q(ISL:Inter-Switch Link,思科交换链路内协议,Cisco专有的Trunk封装方式);
2、R1部署DHCP技术,使得PC1、PC2自动获取IP地址;
3、验证PC1、PC2是否能自动获取IP地址?是否可以正常通信?
三、命令部署:
1、R1子接口命令部署:
R1(config)#int f0/0
R1(config-if)#no shutdown

R1(config-if)#int f0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 192.168.10.254 255.255.255.0

R1(config-subif)#int f0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 192.168.20.254 255.255.255.0
2、R1 DHCP部署:
R1(config)#ip dhcp pool aa
R1(dhcp-config)#network 192.168.10.254 255.255.255.0
R1(dhcp-config)#default-router 192.168.10.0
R1(dhcp-config)#dns-server 8.8.8.8
R1(dhcp-config)#lease 365

R1(config)#ip dhcp pool bb
R1(dhcp-config)#network 192.168.20.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.20.254
R1(dhcp-config)#dns-server 8.8.8.8
R1(dhcp-config)#lease 365

SW1(config)#int range f0/1 - 2
SW1(config-if-range)#spanning-tree portfast

四、验证:
PC1#ping 192.168.20.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 28/38/44 ms