码迷,mamicode.com
首页 > 其他好文 > 详细

DHCP综合实战命令

时间:2020-06-19 13:58:34      阅读:60      评论:0      收藏:0      [点我收藏+]

标签:cond   指定   gate   relay   wait   http   dhcp服务   mask   net   

DHCP综合实战命令

6.1 问题
在复杂的网络环境中,如何配置DHCP服务器?

配置思路:
1.配置二层交换机 acces 和 trunk模式
2.DHCP服务器单臂路由
-开启dhcp,开启接口模式dhcp,
-0/0/1设置ip 并且接口开启dhcp全局
3.DHCP中继代理
-创建vlan 交换连接端口设置trunk
-进vlan设置IP地址开启中继 指定服务器接口地址
-g0/0/3 设置acce 加入vlan300
4.R2设置IP地址设置路由器和三层交换直接静态路由

技术图片

[DHCP]dhcp enable

interface GigabitEthernet0/0/0.2
dot1q termination vid 20
ip address 192.168.20.1 255.255.255.0
arp broadcast enable
dhcp select interface

g0/0/0.1同上

[DHCP]ip route-static 192.168.30.0 24 192.168.1.2
[DHCP]ip route-static 192.168.00.0 24 192.168.1.2
[DHCP]ip route-static 192.168.40.0 24 192.168.1.2
ip pool p3
[DHCP-ip-pool-p3]network 192.168.30.0 mask 24
[DHCP-ip-pool-p3]gateway-list 192.168.30.1
[DHCP-ip-pool-p3]lease day 3
[DHCP-ip-pool-p3]dns-list 3.3.3.3
[DHCP-ip-pool-p3]q

[DHCP]int g0/0/1
[DHCP-GigabitEthernet0/0/1]dhcp select global

[DHCP ZHONGJI]vlan batch 30 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[DHCP ZHONGJI]port-group 1
[DHCP ZHONGJI-port-group-1]group-member g0/0/1 g0/0/2
[DHCP ZHONGJI-port-group-1]port link-type trunk
[DHCP ZHONGJI-GigabitEthernet0/0/1]port link-type trunk
[DHCP ZHONGJI-GigabitEthernet0/0/2]port link-type trunk
[DHCP ZHONGJI-port-group-1]port trunk allow-pas vlan all
[DHCP ZHONGJI-GigabitEthernet0/0/1]port trunk allow-pas vlan all
[DHCP ZHONGJI-GigabitEthernet0/0/2]port trunk allow-pas vlan all
[DHCP ZHONGJI-port-group-1]q
[DHCP ZHONGJI]vlan 300
[DHCP ZHONGJI]int vlanif 30
[DHCP ZHONGJI-Vlanif30]ip add 192.168.30.1 24
[DHCP ZHONGJI-Vlanif30]q
[DHCP ZHONGJI]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[DHCP ZHONGJI-Vlanif40]ip add 192.168.40.1 24
[DHCP ZHONGJI-Vlanif40]q
[DHCP ZHONGJI]int vlanif 300
[DHCP ZHONGJI-Vlanif300]ip add 192.168.2.1 24
[DHCP ZHONGJI-Vlanif300]q
[DHCP ZHONGJI]int g0/0/3
[DHCP ZHONGJI-GigabitEthernet0/0/3]port link-type access
[DHCP ZHONGJI-GigabitEthernet0/0/3]port default vlan 300
[DHCP ZHONGJI-GigabitEthernet0/0/3]q
[DHCP ZHONGJI]ip route-static 192.168.1.0 24 192.168.2.2
[DHCP ZHONGJI]ip route-static 192.168.10.0 24 192.168.2.2
[DHCP ZHONGJI]ip route-static 192.168.20.0 24 192.168.2.2
[DHCP ZHONGJI] User interface con0 is available
[DHCP ZHONGJI]int v30
[DHCP ZHONGJI-Vlanif30]dhcp select relay
[DHCP ZHONGJI-Vlanif30]dhcp relay server-ip 192.168.1.1
[DHCP ZHONGJI-Vlanif30]int v40
[DHCP ZHONGJI-Vlanif40]dhcp select relay
[DHCP ZHONGJI-Vlanif40]dhcp relay server-ip 192.168.1.1

DHCP综合实战命令

标签:cond   指定   gate   relay   wait   http   dhcp服务   mask   net   

原文地址:https://blog.51cto.com/14806008/2505829

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!