文章中我们针对DHCP server提出了一个问题,然后对于其问题进行了研究和分析。在这里和大家一起讨论一下。
在DHCP的使用过程中,不少朋友都对相应的一些应用有些迷惑。这里我们提出一个关于DHCP server的问题。我的问题就是如何给每个VLAN 指定各自的DHCP 域。比如vlan 2 对应DHCP test2 vlan3 对应dhcp test3. 假如:
情况1: 现在有一个router 上做了多个DHCP 域.
然后在switch 上划VLAN 。那么那个交换机上的ip help-address 的IP 是什么呢?是router 上哪个口的IP 呢? 如:在router 上的配制:
- ipdhcpexcluded-address10.0.199.20010.0.199.254!ipdhcppooltest1network10.0.199.0255.255.255.0default-router10.0.199.1dns-server10.0.199.252lease005
- ipdhcppooltest2network10.0.200.0255.255.255.0default-router10.0.200.1dns-server10.0.199.252lease005
在交换机上:
- interfaceVlan199ipaddress10.0.199.1255.255.255.0iphelper-address???????????????
- intvlan200
- ipaddress10.0.200.1255.255.255.0iphelper-address???????????
这时在这里指定的helper-address 是什么呢?才能把vlan199 和vlan200 里的电脑取得相应DHCP scope???
第二种情况:利用局域网中的win2000’s DHCP server 假如dhcp server 的ip 192.168.10.1 在DHCP 上划分两个scope.***个scope 192.168.10.10 -----192.168.10.255 第二个scope 192.16.20.10 ------192.16.20.255.
交换机划分VLAN 之后,如何保证DHCP 服务器使用仍然在其它区域起作用。即VLAN10 里的机器取得***个scope 里的ip: 即从192.168.10.10 -----192.168.10.255 同样,vlan20 取得相应第二个scope 里的IP. 这时在这里指定的helper-address 是什么呢? 才能把vlan199 和vlan200 里的电脑取得相应DHCP scope???
第三种情况:假如在一个3550emi 上划分多个DHCP 域。由于它本身就可路由。并能划VLAN。那么这时在这里指定的helper-address 是什么呢?才能把vlan199 和vlan200 里的电脑取得相应DHCP scope???
- FW:ipdhcppoolvalnx
- networkx.x.x.xx.x.x.x
- default-routerx.x.x.x
其中vlan x 这个pool 是全局pool 的子集
- interfacevlanx
- iphelper-addressx.x.x.x
- ThehelperaddresscanbeaspecificDHCPserveraddress,oritcanbethenetworkaddress
- ifotherDHCPserversareonthedestinationnetworksegment.UsingthenetworkaddressenablesotherserverstorespondtoDHCPrequests.
- Ifyouhavemultipleservers,youcanconfigureonehelperaddressforeachserver.
DHCP relay:
http://www.cisco.com/en/US/products...00800c6ed2.html
FW: 以一个配置案例来做总结吧:
router1 的int fa0/0 上接有dhcp server 。和router2 通过s0/0 连接IP 地址方案如下:
- route1:
- intfa0/010.1.1.254/24intfa0/110.1.2.254/24ints0/0192.168.0.1/30route2:
- intfa0/010.2.1.254/24intfa0/110.2.2.254/24ints0/0192.168.0.2/30dhcpserveradderss:10.1.1.1
配置:
- router1:!ipforward-protocoludp
- !intfa0/0ipaddr10.1.1.254255.255.255.0
- noshutdown!intfa0/1ipaddr10.1.2.254255.255.255.0
- iphelper-address10.1.1.1noshut!
- ints0/0ipaddr192.168.0.1255.255.255.252noshut
- encapppp
- !
- iproute10.2.0.0255.255.0.0192.168.0.2
- !router2:!
- ipforward-protocoludp!intfa0/0ipaddr10.2.1.254255.255.255.0
- iphelper-address10.1.1.1noshutdown!
- intfa0/1ipaddr10.2.2.254255.255.255.0iphelper-address10.1.1.1noshut
- !ints0/0ipaddr192.168.0.2255.255.255.252
- noshutencapppp!iproute10.1.0.0255.255.0.0192.168.0.1!dhcpserver:scope11:router:10.1.1.254
- scope12:router:10.1.2.254scope21:router:10.2.1.254
- scope22:
- router:10.2.2.254
使用VLAN 的情况配置与此相同。只不过把int fa 换成int vlan 而已。你只需要将VLAN 当做是第N 个SCOPE 的ROUTE 选项就行了。在你的交换机上按常规划分好VLAN:
假设有:VLAN20 和VLAN30, 你先在交换机上划分好(这步应该都会做), 然后在路由器上设置VLAN 网关(假设是FA0/0.1:192.168.20.254/24 和FA0/0.2:192.168.30.254/24), 在VLAN20 接口和VLAN30 接口下分别设置ip help-address DHCP_SERVER_ADD,IP FORWARD UDP 等,其实DHCP_SERVER 接在哪里无所谓,只要能够ROUTE 通,就行。关键是DHCP_SERVER 上设置SCOPE 时,你分两个,其中一个为192.168.20.0 网段的,它的相应ROUTE 选项为192.168.20.254, 另一个SCOPE 为192.168.30.0 网段的,它的相应ROUTE 选项为192.168.30.254 。上述设置完成后,记得在两个网段都要能和DHCP_SERVER 通。
知优网 » 浅析DHCP server的应用问题(DHCP的问题)