找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2042|回复: 0

[其它] Routeros DHCP 服务器中继设置

[复制链接]
发表于 2010-6-11 01:37:45 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
资料来自Mikrotik官方
dhcp-relay.jpg

Application ExamplesDynamic Addressing, using DHCP-RelayLet us consider that you have several IP networks 'behind' other routers, but you want to keep all DHCP servers on a single router. To do this, you need a DHCP relay on your network which relies DHCP requests from clients to DHCP server.
This example will show you how to configure a DHCP server and a DHCP relay which serve 2 IP networks - 192.168.1.0/24 and 192.168.2.0/24 that are behind a router DHCP-Relay.

IP addresses of DHCP-Server:
[admin@DHCP-Server] ip address> print
Flags: X - disabled, I - invalid, D - dynamic
#   ADDRESS            NETWORK         BROADCAST       INTERFACE
0   192.168.0.1/24     192.168.0.0     192.168.0.255   To-DHCP-Relay
1   10.1.0.2/24        10.1.0.0        10.1.0.255      Public
[admin@DHCP-Server] ip address>

IP addresses of DHCP-Relay:
[admin@DHCP-Relay] ip address> print
Flags: X - disabled, I - invalid, D - dynamic
#   ADDRESS            NETWORK         BROADCAST       INTERFACE
0   192.168.0.1/24     192.168.0.0     192.168.0.255   To-DHCP-Server
1   192.168.1.1/24     192.168.1.0     192.168.1.255   Local1
2   192.168.2.1/24     192.168.2.0     192.168.2.255   Local2
[admin@DHCP-Relay] ip address>

To setup 2 DHCP Servers on DHCP-Server router add 2 pools. For networks 192.168.1.0/24 and 192.168.2.0:

/ip pool add name=Local1-Pool ranges=192.168.1.11-192.168.1.100
/ip pool add name=Local1-Pool ranges=192.168.2.11-192.168.2.100

[admin@DHCP-Server] ip pool> print
# NAME                                         RANGES
0 Local1-Pool                                  192.168.1.11-192.168.1.100
1 Local2-Pool                                  192.168.2.11-192.168.2.100
[admin@DHCP-Server] ip pool>

Create DHCP Servers:
/ip dhcp-server add interface=To-DHCP-Relay relay=192.168.1.1 \
   address-pool=Local1-Pool name=DHCP-1 disabled=no
/ip dhcp-server add interface=To-DHCP-Relay relay=192.168.2.1 \
   address-pool=Local2-Pool name=DHCP-2 disabled=no

[admin@DHCP-Server] ip dhcp-server> print
Flags: X - disabled, I - invalid
#   NAME         INTERFACE     RELAY           ADDRESS-POOL LEASE-TIME ADD-ARP
0   DHCP-1       To-DHCP-Relay 192.168.1.1     Local1-Pool  3d00:00:00
1   DHCP-2       To-DHCP-Relay 192.168.2.1     Local2-Pool  3d00:00:00
[admin@DHCP-Server] ip dhcp-server>

Configure respective networks:

/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 \
   dns-server=159.148.60.20
/ip dhcp-server network add address=192.168.2.0/24 gateway=192.168.2.1 \
   dns-server 159.148.60.20

[admin@DHCP-Server] ip dhcp-server network> print
# ADDRESS            GATEWAY         DNS-SERVER      WINS-SERVER     DOMAIN
0 192.168.1.0/24     192.168.1.1     159.148.60.20
1 192.168.2.0/24     192.168.2.1     159.148.60.20
[admin@DHCP-Server] ip dhcp-server network>

Configuration of DHCP-Server is done. Now let's configure DHCP-Relay:

/ip dhcp-relay add name=Local1-Relay interface=Local1 \
   dhcp-server=192.168.0.1 local-address=192.168.1.1 disabled=no
/ip dhcp-relay add name=Local2-Relay interface=Local2 \

[admin@DHCP-Relay] ip dhcp-relay> print
Flags: X - disabled, I - invalid
#   NAME                        INTERFACE      DHCP-SERVER     LOCAL-ADDRESS
0   Local1-Relay                Local1         192.168.0.1     192.168.1.1
1   Local2-Relay                Local2         192.168.0.1     192.168.2.1
[admin@DHCP-Relay] ip dhcp-relay>
routeros
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-11-6 15:28 , Processed in 0.047624 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表