The principle of three-tier exchange and DHCP principle, the author here is not explained in detail here to understand the use of three-tier exchange as a DHCP server and assign an IP address to a different network segments through a case study. In a production environment, use a router or switch as a DHCP server to a number of common.
1, configure the DHCP service on SW1, the IP address can be assigned to different segments of four different departments. 2, configured on SW1 VTP Server, VTP Client configuration on SW2 and SW3, and add the relevant departments specified VLAN. 3. Note: Use a relay link between the switch and the switch, and between the router and there is no need
R1 configured as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# Configurations within the router interface IP network and the external network interface IP Rl (config) #int F0 / 0 Rl (config-IF) #ip the Add 10.0.0.2 255.0.0.0 Rl (config-IF) #no SH Rl (config-IF ) #no the shutdown Rl (config-IF) #exit Rl (config) #int F1 / 0 Rl (config-IF) #ip the Add 202.106.123.1 255.255.255.248 Rl (config-IF) #no SH Rl (config-IF ) #no the shutdown # configure a static route entries within the network Rl (config) #ip route 192.168.1.0 255.255.255.0 10.0.0.1 Rl (config) #ip route 192.168.2.0 255.255.255.0 10.0.0.1 Rl (config) # 10.0.0.1 192.168.3.0 255.255.255.0 route IP Rl (config) #ip route 192.168.4.0 255.255.255.0 10.0.0.1
# Set the IP address of the router interface SWl (config) #ip routing SWl (config) #int F0 / 0 SWl (config-IF) #no switchport SWl (config-IF) #ip the Add 10.0.0.1 255.0.0.0 SWl ( config-if) #no shutdown interface link between the relay link to configure the switch # (Trunk) SWl (config) #int Range F0 / -2. 1 SWl (config-IF-Range) #switchport MODE Trunk SWl ( Range-IF-config) #no SH # configure Server the VTP SWl # vlan Database SWl (vlan) #vtp Domain Test SWl (vlan) #vtp Server SWl (vlan) #vtp password 123 SWl (vlan) #vtp Pruning # Create vlan (creating different vlan four sectors) SW1 # vlan Database SW1 (vlan) #vlan 10 SW1 (vlan) #vlan 20 SW1 (vlan) #vlan 30 SW1 (vlan) #vlan 40 # vlan configure virtual interface address SW1 ( config-if) #intvlan 10 SWl (config-IF) #ip the Add 192.168.1.1 255.255.255.0 SWl (config-IF) #no SH SWl (config-IF) #exit SWl (config-IF) 20 is #intvlan SWl (config-IF) #ip the Add 255.255.255.0 192.168.2.1 SW1 (config-if) #no SH SW1 (config-if) #exit SW1 (config-if) #intvlan 30 large column three switches configured DHCP assigns an IP address to a different VLAN SW1 (config-if ) #ip the Add 192.168.3.1 255.255.255.0 SWl (config-IF) #no SH SWl (config-IF) #exit SWl (config-IF) 40 #intvlan SWl (config-IF) 192.168.4.1 #ip the Add 255.255. 255.0 SW1 (config-IF) #no SH # Note: If you want to configure the DHCP relay service, a need to add the address of the DHCP server SW1 (config-if) #ip helper- address [DHCP server address] in the virtual interface vlan # configure a default route, so that access to the external network SW1 (config) #ip route 0.0.0.0 0.0.0.0 10.0.0.2 # Configure different subnet DHCP address pool (because there are four vlan, so to four with the network address pool) SWl (config) #ipdhcp the pool VLAN10 SWl (DHCP-config) #network 192.168.1.0 255.255.255.0 SWl ( config-DHCP) # default-Router 192.168.1.1 SWl (DHCP-config) #-DNS Server 202.106.0.20 SWl (DHCP-config) #lease 2 SWl (DHCP-config) #exit SWl (config) #ipdhcp the pool VLAN20 SWl (DHCP-config) #network 192.168.2.0 255.255.255.0 SWl (DHCP-config) # default-Router 192.168.2.1 SWl (DHCP-config) #-DNS Server 202.106.0.20 SWl (DHCP-config) #lease 2 SWl ( config-DHCP) #exit SWl (config) #ipdhcp the pool VLAN30 SWl (DHCP-config) #network 192.168.3.0 255.255.255.0 SWl (DHCP-config) # default-Router 192.168.3.1 SWl (DHCP-config) # DNS- server 202.106.0.20 SWl (DHCP-config) #lease 2 SWl (DHCP-config) #exit SWl (config) #ipdhcp the pool VLAN40 SWl (DHCP-config) #network 192.168.4.0 255.255.255.0 SWl (DHCP-config) # default-Router 192.168 .4.1 SWl (DHCP-config) #-DNS Server 202.106.0.20 SWl (DHCP-config) #lease 2 # Note: If you want to set the address can be configured to retain excluded-address low-address [high -address] ipdhcp
# Layer configuration of the relay link is a link exchange (Trunk) SW3 are (config) #int F0 / 0 SW3 are (config-IF) #switchport MODE Trunk SW3 are (config-IF) #no SH # Configure VTP client ( after configuring the VTP client can learn to create a three-tier exchange vlan) SW3 # vlan Database SW3 (vlan) #vtp the Test Domain SW3 (vlan) #vtp Client SW3 (vlan) #vtp password 123 SW3 (vlan) #vtp Pruning # the specified interface is added to the corresponding vlan in SW3 are (config) #int F0 /. 1 SW3 are (config-IF) 30 #switchport Access vlan SW3 are (config-IF) #no SH SW3 are (config-IF) #exit SW3 are (config the -if) #int F0 / 2 SW3 are (config-IF) 40 #switchport Access VLAN SW3 are (config-IF) SH #no
After configuring all of the above configuration, the client will automatically obtain IP address is set to DHCP, you can get the corresponding IP, and can access the Internet