1.路由器设置IP
[Huawei]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.2.2 24
[R3-GigabitEthernet0/0/1]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
[R4-GigabitEthernet0/0/1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.3.2.24
2.配置静态路由(默认路由)
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.2.2
[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.3.1
3配置DHCP服务器
3.1创建两个IP地址池
[R1]dhcp enable
[R1]ip pool ppp
[R1i-ip-pool-ppp]network 192.168.1.0 mask 24
[R1-ip-pool-ppp]gateway-list 192.168.1.254
[R1-ip-pool-ppp]dns
[R1-ip-pool-ppp]dns-list 8.8.8.8.
[R1-ip-pool-ppp]lease day 1
[R1-ip-pool-ppp]excluded-ip-address 192.168.1.10 192.168.1.20
[R1-ip-pool-ppp]q
[R1]ip pool ooo
[R1i-ip-pool-ooo]network 192.168.4.0 mask 24
[R1-ip-pool-ooo]gateway-list 192.168.2.1
[R1-ip-pool-ooo]dns
[R1-ip-pool-ooo]dns-list 8.8.8.8
[R1i-ip-pool-ooo]lease day 1
3.2端口启动dhcp 为全局连接
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select global
R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global
配置中继代理
[relay]dhcp enable
[relay]int g0/0/1
[relay-GigabitEthernet0/0/1]dhcp select relay
[relay-GigabitEthernet0/0/1]dhcp relay server-ip 192.168.2.1
结果验证
原文地址:http://blog.51cto.com/14159400/2344782