实验8.DHCP

实验八DHCP
实验任务一:PCA直接通过RTA获得ip地址

  1. 建立物理连接
    1399347-20190706224248449-2124267977.png

  2. 配置RTA作为dhcp服务器
    [RTA-GigabitEthernet0/0]ip address 172.16.0.1 24
    [RTA]dhcp enable//启动dhcp服务器
    [RTA]dhcp server forbidden-ip 172.16.0.1
    [RTA]dhcp server ip-pool 1
    [RTA -dhcp-pool-1]network 172.16.0.0 24//分配的地址池
    [RTA-dhcp-pool-1]gateway-list 172.16.0.1//分配的网关地址
  3. PCA通过dhcp获得ip地址

1399347-20190706224252461-1239807227.png
1399347-20190706224257314-1865985723.png

  1. 查看dhcp服务器相关信息
    [RTA]display dhcp server statistics
    Pool number: 1//地址池一个
    Pool utilization: 0.39%
    Bindings:
    Automatic: 1//分配的地址一个
    Manual: 0
    Expired: 0
    Conflict: 0
    Messages received: 9
    DHCPDISCOVER: 7
    DHCPREQUEST: 2
    DHCPDECLINE: 0
    DHCPRELEASE: 0
    DHCPINFORM: 0
    BOOTPREQUEST: 0
    Messages sent: 4
    DHCPOFFER: 2
    DHCPACK: 2
    DHCPNAK: 0
    BOOTPREPLY: 0
    Bad Messages: 0

[RTA]display dhcp server ip-in-use
IP address Client identifier/ Lease expiration Type
Hardware address
172.16.0.2 0036-6539-642e-3831- Apr 20 16:06:33 2018 Auto(C)
6530-2e30-3230-362d-
4745-302f-302f-31

[RTA]display dhcp server free-ip
Pool name: 1
Network: 172.16.0.0 mask 255.255.255.0
IP ranges from 172.16.0.3 to 172.16.0.254

实验任务二:PCA通过dhcp中继方式获得IP地址

  1. 建立物理连接
  2. 在设备上配置ip地址及路由
    1399347-20190706224307820-1997574413.png

注意:vlan2要创建之后,把GE_0/2加入vlan2才能是能vlan2interface.
RTA配置静态路由:[RTA]ip route-static 172.16.1.0 24 172.16.0.1

  1. RTA配置dhcp服务器,SWA配置dhcp中继
    [SWA]dhcp enable
    [SWA]interface Vlan-interface 1
    [SWA-Vlan-interface1]dhcp select relay
    [SWA-Vlan-interface1]dhcp relay server-address 172.16.0.2

[RTA-GigabitEthernet0/0]ip address 172.16.0.2 24
[RTA]dhcp enable//启动dhcp服务器
[RTA]dhcp server forbidden-ip 172.16.1.1
[RTA]dhcp server ip-pool 1
[RTA -dhcp-pool-1]network 172.16.1.0 24//分配的地址池
[RTA-dhcp-pool-1]gateway-list 172.16.1.1//分配的网关地址
4.PCA通过dhcp中继获取ip地址

1399347-20190706224316011-1649008549.png

转载于:https://www.cnblogs.com/akiz/p/11144480.html

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值