Cisco's DHCP and VLAN synthesis experiment
Experimental content:
PC1 and PC2 need to obtain an IP address through DHCP Server . R1 do one-arm routing and DHCP Relay,R2 interface f2/0 IP address is 192.168.3.1. and PC1 belongs to Vlan10,PC2 belongsto Vlan20,R3(DHCP Server ) belongs to VLAN30.
PC1 belongs to 192.168.1.0 network segment, Gateway is 192.168.1.254 PC2 belongs to 192.168.2.0 network segment, Gateway is 192.168.2.254
Experimental extension Map:
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/14/7ffbf9d129e9c0ba1e2e7245c579c421.png-wh_500x0-wm_3 -wmp_4-s_127943898.png "title=" topology map. png "alt=" 7ffbf9d129e9c0ba1e2e7245c579c421.png-wh_ "/>
Experimental ideas:
VLAN 10,20,30 is configured on S1 and the E0/2 port is trunk port
R1 to create a sub-interface for the VLAN30. And each sub-interface specifies the encapsulation mode and the IP address of the specified DHCP server.
The default route to the host needs to be configured on the DHCP server
Experiment Configuration:
S1 (config) #vlan 10 s1 (Config-vlan) #vlan 20s1 (Config-vlan) #vlan 30s1 (Config-vlan) #do show vlan to see if it has been created and is active S1 (config) #interface ethernet 0/0s1 (config-if) #switchport  ACCESS VLAN 10S1 (config-if) #inter e0/1s1 (config-if) #swi acc vlan 20s1 ( CONFIG-IF) #inter e0/3s1 (config-if) #swi ac vlan 30s1 (config-if) #inter e0/2s1 (config-if ) #switchport trunk encapsulation dot1q s1 (config-if) #switchport mode trunk S1 (config-if) #do show inter e0/2 switchport See if Port 0/2 is a trunk port R1 (config) #interface  FASTETHERNET 0/0.1R1 (config-subif) #encapsulation dot1q 10r1 (config-subif) #ip add  192.168.1.254 255.255.255.0R1 (config-subif) #ip helper-address 192.168.3.1 r1 ( Config) #interface fastethernet 0/0.2r1 (config-subif) #encapsulation dot1q 20r1 (config-subif ) #ip add 192.168.2.254 255.255.255.0R1 (config-subif) #ip helper-address 192.168.3.1 r1 (config) # INTERFACE FA0/0.3R1 (config-subif) #encapsulation dot1q 30r1 (config-subif) #ip add 192.168.3.254 255.255.255.0R1 (config-subif) #inter fa0/0 r1 (config-if) #no shutdown r2 ( Config) #ip dhcp excluded-address 192.168.1.200 192.168.1.255r2 (config) #ip dhcp Excluded-address 192.168.2.200 192.168.2.255r2 (config) #ip dhcp pool pc1 r2 ( Dhcp-config) #network 192.168.1.0 255.255.255.0r2 (dhcp-config) #default-router 192.168.1.254r2 ( Dhcp-config) #dns-server 8.8.8.8r2 (dhcp-config) #lease 2 3 4r2 (config) #ip dhcp POOL PC2R2 (dhcp-config) #network 192.168.2.0 255.255.255.0r2 (dhcp-config) #default-router 192.168.2.254R2 (dhcp-config) #dns-server 8.8.8.8r2 (dhcp-config) #lease 2 3 4r2 (config) #ip route 0.0.0.0 0.0.0.0 192.168.3.254r2 (config) #inter fa2/0r2 (config-if) #ip add 192.168.3.1 255.255.255.0R2 (config-if) #no sh
Experimental validation:
start PC1 no IP address
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/14/f87219808995edcb89636a28acc98b39.png-wh_500x0-wm_3 -wmp_4-s_205816602.png "title=" no Ip.png "alt=" F87219808995edcb89636a28acc98b39.png-wh_ "/>
PC1 using DCHP request IP
650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/14/5f772b4e316d1f6d21b401a39fca8036.png-wh_500x0-wm_3 -wmp_4-s_3446676455.png "style=" Float:none; "title=" Request Ip.png "alt=, 5f772b4e316d1f6d21b401a39fca8036.png-wh_"/>
PC1 successful request to IP.
650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/14/c6e74243f700f30642947800c2e4afc2.png-wh_500x0-wm_3 -wmp_4-s_2939161581.png "style=" Float:none; "title=" validates the result. png "alt=" C6e74243f700f30642947800c2e4afc2.png-wh_ "/>
This article is from the "New Network Society Blog" blog, please be sure to keep this source http://xwxhvip.blog.51cto.com/13020757/1981723
Cisco's DHCP and VLAN synthesis experiment