vpp系列8-dhcp client

情到浓时终转凉″ 提交于 2020-08-17 01:01:58

前言

vpp并没有dhcp server功能,只有dhcp client功能,具体命令见这里

dhcp server安装

dhcp server采用isc-dhcp-server,具体安装见我另一篇文章

注意,要确保二层是通的

vpp dhcp client配置

cli

set dhcp client [del] intfc <interface> [hostname <name>].

usage

create interface vmxnet3 0000:13:00.0 bind

#添加
set dhcp client intfc vmxnet3-0/13/0/0 hostname vppgate
#查看
show dhcp client intfc vmxnet3-0/13/0/0
#删除
set dhcp client del intfc vmxnet3-0/13/0/0

测试

此时show dhcp client查看已经分配了10.241.100.11的IP

vpp# show int addr
local0 (dn):
vmxnet3-0/13/0/0 (up):
  L3 10.241.100.11/16
vpp# show dhcp client
[0] vmxnet3-0/13/0/0 state DHCP_BOUND installed 1 addr 10.241.100.11/16 gw 10.241.255.254 server 10.241.4.6 dns 8.8.8.8 dns 4.4.4.4

去dhcp server端查看分配情况, cat /var/lib/dhcp/dhcpd.leases

lease 10.241.100.11 {
  starts 0 2020/08/16 15:39:26;
  ends 0 2020/08/16 15:49:26;
  cltt 0 2020/08/16 15:39:26;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:50:56:ab:5a:69;
  uid "\000vpp 1.1\000";
  client-hostname "vppgate";
}

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!