当前位置:   article > 正文

私有云落地解决方案之网络篇-关键技术-DHCP地址-2_network 10.10.10.0 mask 24

network 10.10.10.0 mask 24

作者:【吴业亮】

博客:https://wuyeliang.blog.csdn.net/

华为交换机&路由器&防火墙DHCP常用操作

一、排除不参与自动分配的IP地址

1、采用全局地址池时的配置:

<switch> system-view
[switch] ip pool pool1
[switch-ip-pool-pool1] network 10.10.10.0 mask 24
[switch-ip-pool-pool1] gateway-list 10.10.10.1
[switch-ip-pool-pool1] excluded-ip-address 10.10.10.200 10.10.10.200
  • 1
  • 2
  • 3
  • 4
  • 5

2、采用接口地址池时的配置:

<switch> system-view
[switch] dhcp enable
[switch] interface vlanif 200
[switch-Vlanif200] ip address 10.10.10.1 24
[switch-Vlanif200] dhcp select interface
[switch-Vlanif200] dhcp server excluded-ip-address 10.10.10.200 10.10.10.200
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

二、修改租期

缺省情况下,设备作为DHCP服务器的缺省租期是1天;设备作为DHCP客户端时未配置缺省租期。

1、采用全局地址池时的配置:

<switch> system-view
[switch] ip pool pool1
[switch-ip-pool-pool1] lease day 10
  • 1
  • 2
  • 3

2、采用接口地址池时的配置:

<switch> system-view
[switch] interface vlanif 200
[switch-Vlanif200] dhcp server lease day 10
  • 1
  • 2
  • 3

3、在作为DHCP客户端的设备上,修改租期为10天(即864000秒)。

<switch> system-view
[switch] interface vlanif 200
[switch-Vlanif200] dhcp client expected-lease 864000
  • 1
  • 2
  • 3

三、为客户端分配固定的IP地址

1、采用全局地址池时的配置:

<switch> system-view
[switch] ip pool pool1
[switch-ip-pool-pool1] static-bind ip-address 10.10.10.200 mac-address add1-fd91-e9a0
  • 1
  • 2
  • 3

2、采用接口地址池时的配置:

<switch> system-view
[switch] interface vlanif 200
[switch-Vlanif200] dhcp server static-bind ip-address 10.10.10.200 mac-address add1-fd91-e9a0
  • 1
  • 2
  • 3

四、取消为客户端分配固定的IP地址

1、采用全局地址池时的配置:

回收IP地址10.10.10.5

<switch> reset ip pool name pool1 10.10.10.5
  • 1

解除静态绑定关系

<switch> system-view
[switch] ip pool pool1
[switch-ip-pool-pool1] undo static-bind ip-address 10.10.10.5
  • 1
  • 2
  • 3

2、采用接口地址池时的配置:

回收IP地址10.10.10.5

<switch> reset ip pool interface vlanif200 10.10.10.5
  • 1

解除静态绑定关系

<switch> system-view
[switch] interface vlanif 200
[switch-Vlanif200] undo dhcp server static-bind ip-address 10.10.10.5
  • 1
  • 2
  • 3

五、查看已使用的IP地址

<switch> display ip pool name pool1 used
  • 1

六、清除冲突地址

1、采用全局地址池时的配置:

<switch> reset ip pool name pool1 conflict
  • 1

2、采用接口地址池时的配置:

<switch> reset ip pool interface vlanif200 conflict
  • 1

七、扩大地址池范围

1、如果没有分配出去

1.1、采用全局地址池时的配置:

<switch> system-view
[switch] ip pool pool1
[switch-ip-pool-pool1] undo network
[switch-ip-pool-pool1] network 10.10.10.0 mask 24  //调整掩码长度
  • 1
  • 2
  • 3
  • 4

1.2、采用接口地址池时的配置:

<switch> system-view
[switch] interface vlanif 200
[switch-Vlanif200] ip address 10.10.10.1 24  //调整掩码长度
[switch-Vlanif200] dhcp select interface  //重新使能接口地址池功能
  • 1
  • 2
  • 3
  • 4

2、如果已经分配出去

2.1、采用全局地址池时的配置:

<switch> reset ip pool name pool1 all  //回收所有的IP地址
<switch> system-view
[switch] dhcp server ping packet 3  //配置防止IP地址重复分配功能
[switch] dhcp server ping timeout 200  //配置防止IP地址重复分配功能
[switch] ip pool pool1
[switch-ip-pool-pool1] undo network
[switch-ip-pool-pool1] network 10.10.10.0 mask 24  //调整掩码长度
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

2.2、采用接口地址池时的配置:

<switch> system-view
[switch] dhcp server ping packet 3  //配置防止IP地址重复分配功能
[switch] dhcp server ping timeout 200  //配置防止IP地址重复分配功能
[switch] interface vlanif 200
[switch-Vlanif200] ip address 10.10.10.1 24  //调整掩码长度
[switch-Vlanif200] dhcp select interface  //重新使能接口地址池功能
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

八、缩小地址池范围

1、如果没有分配出去

1.1、采用全局地址池时的配置:

<switch> system-view
[switch] ip pool pool1
[switch-ip-pool-pool1] undo network
[switch-ip-pool-pool1] network 10.10.10.0 mask 25  //调整掩码长度
  • 1
  • 2
  • 3
  • 4

1.2、采用接口地址池时的配置:

<switch> system-view
[switch] interface vlanif 200
[switch-Vlanif200] ip address 10.10.10.1 25  //调整掩码长度
[switch-Vlanif200] dhcp select interface  //重新使能接口地址池功能
  • 1
  • 2
  • 3
  • 4

2、如果已经分配出去

2.1、采用全局地址池时的配置:

<switch> reset ip pool name pool1 all  //回收所有的IP地址
<switch> system-view
[switch] dhcp server ping packet 3  //配置防止IP地址重复分配功能
[switch] dhcp server ping timeout 200  //配置防止IP地址重复分配功能
[switch] ip pool pool1
[switch-ip-pool-pool1] undo network
[switch-ip-pool-pool1] network 10.10.10.0 mask 25  //调整掩码长度
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

2.2、采用接口地址池时的配置:

<switch> system-view
[switch] dhcp server ping packet 3  //配置防止IP地址重复分配功能
[switch] dhcp server ping timeout 200  //配置防止IP地址重复分配功能
[switch] interface vlanif 200
[switch-Vlanif200] ip address 10.10.10.1 25  //调整掩码长度
[switch-Vlanif200] dhcp select interface  //重新使能接口地址池功能
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

九、防止从仿冒的DHCP服务器获取IP地址

1.全局下的配置。

<switch> system-view
[switch] dhcp enable
[switch] dhcp snooping enable
  • 1
  • 2
  • 3

2.连接DHCP客户端侧接口的配置。所有连接DHCP客户端的接口都需要配置,以接口GE 1/0/1为例。

[switch] interface gigabitethernet 1/0/1
[switch-GigabitEthernet1/0/1] dhcp snooping enable
[switch-GigabitEthernet1/0/1] quit
  • 1
  • 2
  • 3

3.连接DHCP服务器侧接口的配置。

[switch] interface gigabitethernet 1/0/2
[switch-GigabitEthernet1/0/2] dhcp snooping trusted
[switch-GigabitEthernet1/0/2] quit
  • 1
  • 2
  • 3

十、关闭DHCP服务

<switch> system-view
[switch] undo dhcp enable
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/293322
推荐阅读
相关标签
  

闽ICP备14008679号