关于VLAN中DHCP域的问题
2010-09-27 12:04:13 来源:WEB开发网FW:ip dhcp pool valn x
network x.x.x.x x.x.x.x
default-router x.x.x.x
其中vlan x 这个pool 是全局pool 的子集
interface vlan x
ip helper-address x.x.x.x
The helper address can be a specific DHCP server address, or it can be the network address
if other DHCP servers are on the destination network segment. Using the network address enables other servers to respond to DHCP requests.
If you have multiple servers, you can configure one helper address for each server.
DHCP relay:
http://www.cisco.com/en/US/products...00800c6ed2.html
FW: 以一个配置案例来做总结吧:
router1 的int fa0/0 上接有dhcp server 。和router2 通过s0/0 连接IP 地址方案如下:
route1:
int fa0/0 10.1.1.254/24 int fa0/1 10.1.2.254/24 int s0/0 192.168.0.1/30 route2:
int fa0/0 10.2.1.254/24 int fa0/1 10.2.2.254/24 int s0/0 192.168.0.2/30 dhcp server adderss:10.1.1.1
配置:
router1: ! ip forward-protocol udp
! int fa0/0 ip addr 10.1.1.254 255.255.255.0
no shutdown ! int fa0/1 ip addr 10.1.2.254 255.255.255.0
ip helper-address 10.1.1.1 no shut !
int s0/0 ip addr 192.168.0.1 255.255.255.252 no shut
encap ppp
!
ip route 10.2.0.0 255.255.0.0 192.168.0.2
! router2: !
ip forward-protocol udp ! int fa0/0 ip addr 10.2.1.254 255.255.255.0
ip helper-address 10.1.1.1 no shutdown !
int fa0/1 ip addr 10.2.2.254 255.255.255.0 ip helper-address 10.1.1.1 no shut
! int s0/0 ip addr 192.168.0.2 255.255.255.252
no shut encap ppp ! ip route 10.1.0.0 255.255.0.0 192.168.0.1 ! dhcp server: scope 11: router:10.1.1.254
scope 12: router:10.1.2.254 scope 21: router:10.2.1.254
scope 22:
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 通。
编缉推荐阅读以下文章
- 暂无相关文章
更多精彩
赞助商链接