【RouterOS】——CLI 1 WAN (DHCP Client) and 1 LAN (DHCP Server)
| 本帖最後由 角色 於 2013-3-10 23:15 編輯 
 Add alias to interface Eth1 and Eth2:
 #複製代碼/interface ethernet
set 2 name=Public
set 10 name=Local
 Add interface Public as DHCP client:
 #複製代碼/ip dhcp-client
add interface=Public disable=no
 Add your ISP' DNS:
 #複製代碼/ip dns
set servers=8.8.8.8,8.8.4.4 allow-remote-requests=yes
 Or just use DHCP ISP's DNS
 #複製代碼/ip dns
set allow-remote-requests=yes
 Add IP to Local
 #複製代碼add address=192.168.0.1/24 interface=Local
 Add DHCP-server and DHCP-Pool to interface Local
 #複製代碼/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
 Add firewall NAT-rule
 #複製代碼/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=Public
 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.
 |