当前位置:网站首页>VLAN division, automatic allocation of IP to all hosts through DHCP, and communication accessible throughout the network

VLAN division, automatic allocation of IP to all hosts through DHCP, and communication accessible throughout the network

2022-07-24 00:55:00 .98℃

Catalog

 1. requirement

 2. Topology

3. analysis :

4. To configure :

4.1. Switch configuration (vlan Division and setting trunk link ):

4.2. Router r1 and r2 Configuration of ( Interface ip,DHCP, Static routing )

5. verification :



 

 1. requirement

  1. In each switch, create vlan2 and vlan3, And put it in the figure pc1、pc3、pc5 Divided into corresponding switches vlan2 in 、 take pc2、pc4、pc6 Divided into corresponding switches vlan3 in .
  2. adopt DHCP Protocols are automatically assigned to computers ip Address .
  3. It is required that data traffic can pass through the whole network .

 2. Topology

3. analysis :

  1.   According to the topology, the router is divided into three broadcast domains , Therefore, it is divided into 192.168.1.0/24;2.0/24;3.0/24 Three network segments of .
  2. Because it is divided into two under the broadcast domain vlan, So divide the original network segment equally .
  3. Both routers need to be turned on DHCP.
  4. Network wide accessibility , You need to implement different vlan Interaction , And the setting of static route .

4. To configure :

4.1. Switch configuration (vlan Division and setting trunk link ):

  •   Switch 1 Configuration of ( The other three are similar )
[sw1]vlan 2
[sw1-vlan2]q
[sw1]vlan 3
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port def vlan 2
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port d vlan 3

[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk	
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 3

4.2. Router r1 and r2 Configuration of ( Interface ip,DHCP, Static routing )

[r1]int g0/0/1.1
[r1-GigabitEthernet0/0/1.1]ip add 192.168.1.1 25	
[r1-GigabitEthernet0/0/1.1]dot1q termination vid 2 	
[r1-GigabitEthernet0/0/1.1]arp broadcast enable 
[r1]int g0/0/1.2
[r1-GigabitEthernet0/0/1.2]ip add 192.168.1.129 25		
[r1-GigabitEthernet0/0/1.2]dot1q termination  vid 3	
[r1-GigabitEthernet0/0/1.2]arp broadcast en
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.3.1 24

[r1]dhcp en
[r1]ip pool p1
[r1-ip-pool-p1]network 192.168.1.0 mask 25
[r1-ip-pool-p1]gateway-list 192.168.1.1
[r1-ip-pool-p1]dns-list 114.114.114.114 8.8.8.8
[r1]dhcp en
[r1]ip pool p2
[r1-ip-pool-p2]network 192.168.1.128 mask 25
[r1-ip-pool-p2]gateway-list 192.168.1.129
[r1-ip-pool-p2]dns-list 114.114.114.114 8.8.8.8
[r1]int g0/0/1.1
[r1-GigabitEthernet0/0/1.1]dhcp select global
[r1]int g0/0/1.2
[r1-GigabitEthernet0/0/1.2]dhcp select global
	
[r1]ip route-static 192.168.2.0 24 192.168.3.2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.3.2 24
[r2-]int g0/0/1.1
[r2-GigabitEthernet0/0/1.1]ip add 192.168.2.1 25
[r2-GigabitEthernet0/0/1.1]dot1q termination vid 2
[r2-GigabitEthernet0/0/1.1]arp broadcast en
[r2]int g0/0/1.2
[r2-GigabitEthernet0/0/1.2]ip add 192.168.2.129 25
[r2-GigabitEthernet0/0/1.2]dot1q termination vid 3
[r2-GigabitEthernet0/0/1.2]arp broadcast en

[r2]dhcp en
[r2]ip pool p3
[r2-ip-pool-p3]network 192.168.2.0 mask 25
[r2-ip-pool-p3]gateway-list 192.168.2.1
[r2-ip-pool-p3]dns-list 114.114.114.114 8.8.8.8
[r2]dhcp en 
[r2]ip pool p4
[r2-ip-pool-p4]network 192.168.2.128 mask 25
[r2-ip-pool-p4]gateway-list 192.168.2.129
[r2-ip-pool-p4]dns-list 114.114.114.114 8.8.8.8
[r2]int g0/0/1.1
[r2-GigabitEthernet0/0/1.1]dhcp select global
[r2]int g0/0/1.2
[r2-GigabitEthernet0/0/1.2]dhcp select global

[r2]ip route-static 192.168.1.0 24 192.168.3.1

5. verification :

  • DHCP Automatic partition IP result :

  •   Achieve communication (pc5->pc1,pc3->pc6):

原网站

版权声明
本文为[.98℃]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230540476089.html