您现在的位置: 首页 > 网站导航收录 > 百科知识百科知识
启用dhcp(路由器做DHCP服务器配置命令)
网段,地址,太多启用dhcp(路由器做DHCP服务器配置命令)
发布时间:2019-02-08加入收藏来源:互联网点击:
前面讲过了三层交换机如何配置DHCP,现在用路由器配置其实更简单
拓扑图如下:
其中172.16.0.0网段我还是采用/24的配置方式。因为我配置的大环境用不了太多IP地址
Router(config)#service dhcp//开启dhcp服务Router(config)#ip dhcp pool sub//配置名为sub的地址池Router(dhcp-config)#network 172.16.4.0 255.255.255.0//设置为/24的网段Router(dhcp-config)#default-router 172.16.4.1Router(dhcp-config)#dns-server 172.16.4.2Router(config)#ip dhcp excluded-address 172.16.4.1 172.16.4.2Router(config)#interface GigabitEthernet0/1Router(config-if)#ip address 172.16.4.1 255.255.255.0//端口IP一定要注意为/24
配置结果:
顺便再做个NAT使其连接外部网络
自定义的地址池为:201.4.4.10-201.4.4.100
命令如下:
Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#ip nat pool sub 201.4.4.10 201.4.4.100 netmask 255.255.255.0Router(config)#ip nat inside source list 1 pool subRouter(config)#access-list 1 permit 172.16.4.0 255.255.255.0Router(config)#int g 0/1Router(config-if)#ip nat insideRouter(config-if)#int g0/0Router(config-if)#ip nat outsideRouter(config-if)#ebd.Router(config-if)#endRouter#show ip nat statistics//查看nat配置Total translations: 0 (0 static, 0 dynamic, 0 extended)Outside Interfaces: GigabitEthernet0/0Inside Interfaces: GigabitEthernet0/1Hits: 0 Misses: 1Expired translations: 0Dynamic mappings:-- Inside Sourceaccess-list 1 pool sub refCount 0pool sub: netmask 255.255.255.0start 201.4.4.10 end 201.4.4.100type generic, total addresses 91 , allocated 0 (0%), misses 0Router#
路由协议就选rip了
不要忘记配置静态路由!
测试如下:
本文到此结束,希望对大家有所帮助呢。
上一篇:起一个好听的名字(你还再为给宝宝起名字而焦虑吗?试试这三招,宝宝名字肯定好听!)
下一篇:返回列表
相关链接 |
||
网友回复(共有 0 条回复) |