锐捷配置DHCP动态分配地址

2023-12-25 19:35:06

一、实验拓扑


二、实验目的


配置DHCP为四个部门动态分配IP地址

三、实验配置


第一步:配置基本IP地址并对端口进行规划

SW1

SW1(config)#vlan range 10,20,30,40,100
SW1(config-vlan-range)#exit
SW1(config)#interface vlan 10
SW1(config-if-VLAN 10)#ip address 192.168.10.254 255.255.255.0
SW1(config)#interface vlan 20
SW1(config-if-VLAN 20)#ip address 192.168.20.254 255.255.255.0
SW1(config)#interface vlan 30
SW1(config-if-VLAN 30)#ip address 192.168.30.254 255.255.255.0
SW1(config)#interface vlan 40
SW1(config-if-VLAN 40)#ip address 192.168.40.254 255.255.255.0
SW1(config)#interface vlan 100
SW1(config-if-VLAN 10)#ip address 192.168.100.254 255.255.255.0

SW1(config)#interface gigabitEthernet 0/1
SW1(config-if-GigabitEthernet 0/1)#switchport mode trunk?
SW1(config-if-GigabitEthernet 0/1)#switchport trunk allowed vlan remove 1-4094
SW1(config-if-GigabitEthernet 0/1)#switchport trunk allowed vlan add 10,20,100

SW1(config)#interface gigabitEthernet 0/2
SW1(config-if-GigabitEthernet 0/2)#switchport mode trunk?
SW1(config-if-GigabitEthernet 0/2)#switchport trunk allowed vlan remove 1-4094
SW1(config-if-GigabitEthernet 0/2)#switchport trunk allowed vlan add 30,40,100
?

SW2

SW2(config)#vlan range 10,20,100
SW2(config-vlan-range)#exit
SW2(config)#interface vlan 100
SW2(config-if-VLAN 100)#ip address 192.168.100.1 255.255.255.0

SW2(config)#interface gigabitEthernet 0/1
SW2(config-if-GigabitEthernet 0/1)#switchport mode trunk?
SW2(config-if-GigabitEthernet 0/1)#switchport trunk allowed vlan remove 1-4094
SW2(config-if-GigabitEthernet 0/1)#switchport trunk allowed vlan add 10,20,100

SW2(config)#interface gigabitEthernet 0/2?
SW2(config-if-GigabitEthernet 0/2)#switchport mode access?
SW2(config-if-GigabitEthernet 0/2)#switchport access vlan 10
SW2(config)#interface gigabitEthernet 0/3?
SW2(config-if-GigabitEthernet 0/3)#switchport mode access?
SW2(config-if-GigabitEthernet 0/3)#switchport access vlan 20

SW3

SW3(config)#vlan range 10,20,100
SW3(config-vlan-range)#exit
SW3(config)#interface vlan 100
SW3(config-if-VLAN 100)#ip address 192.168.100.2 255.255.255.0

SW3(config)#interface gigabitEthernet 0/1
SW3(config-if-GigabitEthernet 0/1)#switchport mode trunk?
SW3(config-if-GigabitEthernet 0/1)#switchport trunk allowed vlan remove 1-4094
SW3(config-if-GigabitEthernet 0/1)#switchport trunk allowed vlan add 30,40,100
SW3(config)#interface gigabitEthernet 0/2?
SW3(config-if-GigabitEthernet 0/2)#switchport mode access?
SW3(config-if-GigabitEthernet 0/2)#switchport access vlan 30
SW3(config)#interface gigabitEthernet 0/3
SW3(config-if-GigabitEthernet 0/3)#switchport mode access?
SW3(config-if-GigabitEthernet 0/3)#switchport access vlan 40

第二步:配置dhcp地址池

SW1

service dhcp

SW1(config)#ip dhcp pool vlan10
SW1(dhcp-config)#network 192.168.10.0 255.255.255.0
SW1(dhcp-config)#default-router 192.168.10.254

SW1(config)#ip dhcp pool vlan20
SW1(dhcp-config)#network 192.168.20.0 255.255.255.0
SW1(dhcp-config)#default-router 192.168.20.254


SW1(config)#ip dhcp pool vlan30
SW1(dhcp-config)#network 192.168.30.0 255.255.255.0
SW1(dhcp-config)#default-router 192.168.30.254

SW1(config)#ip dhcp pool vlan40
SW1(dhcp-config)#network 192.168.40.0 255.255.255.0
SW1(dhcp-config)#default-router 192.168.40.254

SW2

service dhcp

SW3

service dhcp

四、验证


1、信息部能够自动获取地址

2、行政部能够自动获取地址

3、行政部能够ping通网关

4、销售部能够ping通网关

5、财务部能够ping通网关

6、销售部ping不通行政部

7、信息部ping不通销售部

文章来源:https://blog.csdn.net/m0_74862906/article/details/135206249
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。