华为组网实例:vlan间互通+DHCP中继

华为组网实例:企业内部组网实例,三层交换机实现vlan间互通,DHCP中继,保留地址等

    • 一、SW核心交换机的配置
      • vlan划分
      • VLAN配置IP
      • 检查结果
    • 二、路由器配置
      • 开启DHCP
      • 加入回执路由
      • 创建各个vlan的地址池
    • 三、配置DHCP中继
    • 四、保留部分IP地址
    • 五、重新获取和释放地址

华为组网实例:vlan间互通+DHCP中继_第1张图片

一、SW核心交换机的配置

vlan划分

vlan batch 10 20 30 99

int g0/0/1
port link-type access 
port default vlan 10
q

int g0/0/2
port link-type access 
port default vlan 20
q

int g0/0/3
port link-type access 
port default vlan 30
q

int g0/0/24
port link-type access 
port default vlan 99
q

VLAN配置IP

interface Vlanif10   
ip address 192.168.0.254 255.255.255.0
q

interface Vlanif20
 ip address 192.168.20.254 24
q
 
interface Vlanif30
 ip address 192.168.30.254 24
q
 
interface Vlanif99
ip address 192.168.99.2 255.255.255.0
q

检查结果

[hexin-sw]dis ip in b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           unassigned           down       down      
Vlanif10                          192.168.0.1/24       up         up        
Vlanif20                          192.168.20.1/24      up         up        
Vlanif30                          192.168.30.1/24      up         up        
Vlanif99                          192.168.99.2/24      up         up

二、路由器配置

开启DHCP

dhcp enable                 #全局模式下开启DHCP
int g0/0/0
ip add 192.168.99.254 24
dhcp select global        #此接口选择全局的地址池给DHCP客户端使用
q

加入回执路由

ip route-static 192.168.0.0 255.255.255.0 192.168.99.2
ip route-static 192.168.20.0 255.255.255.0 192.168.99.2
ip route-static 192.168.30.0 255.255.255.0 192.168.99.2

创建各个vlan的地址池

ip pool vlan10
 gateway-list 192.168.0.254
 network 192.168.0.0 mask 255.255.255.0 
 dns-list 114.114.114.114
q

ip pool vlan20
 gateway-list 192.168.20.254 
 network 192.168.20.0 mask 255.255.255.0 
 dns-list 114.114.114.114
q

ip pool vlan30
 gateway-list 192.168.30.254 
 network 192.168.30.0 mask 255.255.255.0 
 dns-list 114.114.114.114
q

ip pool vlan99
 gateway-list 192.168.99.254 
 network 192.168.99.0 mask 255.255.255.0 
 dns-list 114.114.114.114
q

检查结果

[500m-route]dis ip pool 
  -----------------------------------------------------------------------
  Pool-name      : vlan10
  Pool-No        : 0
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.0.254   
  Mask           : 255.255.255.0
  VPN instance   : --

  -----------------------------------------------------------------------
  Pool-name      : vlan20
  Pool-No        : 1
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.20.254  
  Mask           : 255.255.255.0
  VPN instance   : --

  -----------------------------------------------------------------------
  Pool-name      : vlan30
  Pool-No        : 2
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.30.254  
  Mask           : 255.255.255.0
  VPN instance   : --

 IP address Statistic
    Total       :759   
    Used        :0          Idle        :759   
    Expired     :0          Conflict    :0          Disable   :0 

三、配置DHCP中继

SW核心交换机上配置DHCP中继

dhcp enable

interface Vlanif10
dhcp select relay
dhcp relay server-ip 192.168.99.254
q

interface Vlanif20
dhcp select relay
dhcp relay server-ip 192.168.99.254
q

interface Vlanif30
dhcp select relay
dhcp relay server-ip 192.168.99.254
q

interface Vlanif99
dhcp select relay
dhcp relay server-ip 192.168.99.254
q

检查一下

interface Vlanif10
 ip address 192.168.0.254 255.255.255.0
 dhcp select relay
 dhcp relay server-ip 192.168.99.254
 
interface Vlanif20
 ip address 192.168.20.254 255.255.255.0
 dhcp select relay
 dhcp relay server-ip 192.168.99.254
 
interface Vlanif30
 ip address 192.168.30.254 255.255.255.0
 dhcp select relay
 dhcp relay server-ip 192.168.99.254
 

四、保留部分IP地址

ip pool vlan10
excluded-ip-address 192.168.0.200 192.168.0.253
q

ip pool vlan20
excluded-ip-address 192.168.20.200 192.168.20.253
q

ip pool vlan30
excluded-ip-address 192.168.30.200 192.168.30.253
q

五、重新获取和释放地址

ipconfig /release   释放地址
ipconfig /renew    重新获取地址

你可能感兴趣的:(#,DHCP,华为,网络,智能路由器)