電訊茶室's Archiver

角色 發表於 2013-1-2 23:08

【RouterOS】——CLI 1 WAN (DHCP Client) and 1 LAN (DHCP Server)

[i=s] 本帖最後由 角色 於 2013-3-10 23:15 編輯 [/i]

Add alias to interface Eth1 and Eth2:[code]
/interface ethernet
set 2 name=Public
set 10 name=Local
[/code]#

Add interface Public as DHCP client:[code]
/ip dhcp-client
add interface=Public disable=no
[/code]#

Add your ISP' DNS:[code]
/ip dns
set servers=8.8.8.8,8.8.4.4 allow-remote-requests=yes
[/code]#

Or just use DHCP ISP's DNS[code]
/ip dns
set allow-remote-requests=yes
[/code]#

Add IP to Local[code]
add address=192.168.0.1/24 interface=Local
[/code]#

Add DHCP-server and DHCP-Pool to interface Local[code]
/ip pool
addd name=dhcp-pool range=192.168.0.10-192.168.0.254
/ip dhcp-server
add name=dhcp inteface=Local address-pool=dhcp-pool disabled=no
/ip dhcp-server network
add address=192.168.0.0/24 gateway=192.168.0.1 dns-server=192.168.0.1
[/code]#

Add firewall NAT-rule[code]
/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=Public
[/code]#

Please note that if a switch is connected to the Local port, ALL LAN ports of the switch could be used. The PC's IP, gateway and DNS are given by the DHCP Server at the Local port.

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.