RB 750 Setup Sample

MikroTikRouterOS RB450G
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

RB 750 Setup Sample

文章 yehlu »

http://www.mobile01.com/topicdetail.php ... 84&r=5&p=9

routerBOARD 750 系統預設
Ethernet-1 = WAN = DHCP Client
Ethernet-2 = LAN = DHCP Server
Ethernet-3 ~ 5 掛入 Ethernet-2 (其他LAN)

清除設定,恢復系統預設值:
/system reset-configuration
還原預設值後下一次登入,記得 password 改密碼

以下為單一WAN, PPPoE
====================================================================
# 移除 WAN 預設的 DHCP Client,設定 ADSL 撥接
/ip dhcp-client remove 0
/interface pppoe-client add name=PPPoE-1 interface=ether1-gateway user=********@hinet.net password=******** use-peer-dns=yes add-default-route=yes dial-on-demand=no disabled=no allow=pap,chap,mschap1,mschap2 max-mru=1480 max-mtu=1480 mrru=disabled profile=default

# 單一線路時:
/ip firewall nat remove 0
/ip firewall nat add chain=srcnat action=masquerade out-interface=PPPoE-1

# 時區 及 時間伺服器 (clock.stdtime.gov.tw)(tock.stdtime.gov.tw)
/system clock set time-zone-name=Asia/Taipei
/system ntp client set enabled=yes mode=unicast primary-ntp=220.130.158.71 secondary-ntp=220.130.158.72

/interface print
====================================================================

以下為 4-WAN + 1-LAN, PPPoE
====================================================================
# 設定主要區網(5) IP (ip address 0 = 192.168.88.1) 及 DHCP Server
/ip address set 0 interface=ether5-local-slave
/ip dhcp-server set default interface=ether5-local-slave

# set port name , Ethernet-1 --> WAN , Ethernet-5 --> LAN (master)
/interface ethernet set 0 name=1-WAN master-port=none
/interface ethernet set 1 name=2-WAN master-port=none
/interface ethernet set 2 name=3-WAN master-port=none
/interface ethernet set 3 name=4-WAN master-port=none
/interface ethernet set 4 name=5-LAN master-port=none
/interface print

# 以上為第一段*************** 連線也許會短暫中斷,重新連接就好

# Remove default DHCP Client;set DNS
/ip dhcp-client remove 0
/ip dns set servers=168.95.1.1,168.95.192.1

# 設定 ADSL 撥接

/interface pppoe-client add name=PPPoE-1 interface=1-WAN user=********@hinet.net password=******** use-peer-dns=no add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no max-mru=1480 max-mtu=1480 mrru=disabled profile=default
/interface pppoe-client add name=PPPoE-2 interface=2-WAN user=********@hinet.net password=******** use-peer-dns=no add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no max-mru=1480 max-mtu=1480 mrru=disabled profile=default
/interface pppoe-client add name=PPPoE-3 interface=3-WAN user=********@hinet.net password=******** use-peer-dns=no add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no max-mru=1480 max-mtu=1480 mrru=disabled profile=default
/interface pppoe-client add name=PPPoE-4 interface=4-WAN user=********@hinet.net password=******** use-peer-dns=no add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no max-mru=1480 max-mtu=1480 mrru=disabled profile=default
/interface print

#Load Balance
/ip firewall mangle add chain=input in-interface=1-WAN action=mark-connection new-connection-mark=ADSL-1 connection-state=new comment="Load Balance"
/ip firewall mangle add chain=input in-interface=2-WAN action=mark-connection new-connection-mark=ADSL-2 connection-state=new
/ip firewall mangle add chain=input in-interface=3-WAN action=mark-connection new-connection-mark=ADSL-3 connection-state=new
/ip firewall mangle add chain=input in-interface=4-WAN action=mark-connection new-connection-mark=ADSL-4 connection-state=new

/ip firewall mangle add chain=output connection-mark=ADSL-1 action=mark-routing new-routing-mark=toADSL-1
/ip firewall mangle add chain=output connection-mark=ADSL-2 action=mark-routing new-routing-mark=toADSL-2
/ip firewall mangle add chain=output connection-mark=ADSL-3 action=mark-routing new-routing-mark=toADSL-3
/ip firewall mangle add chain=output connection-mark=ADSL-4 action=mark-routing new-routing-mark=toADSL-4

/ip firewall mangle add chain=prerouting action=mark-connection dst-address-type=!local in-interface=5-LAN new-connection-mark=ADSL-1 per-connection-classifier=both-addresses-and-ports:4/0
/ip firewall mangle add chain=prerouting action=mark-connection dst-address-type=!local in-interface=5-LAN new-connection-mark=ADSL-2 per-connection-classifier=both-addresses-and-ports:4/1
/ip firewall mangle add chain=prerouting action=mark-connection dst-address-type=!local in-interface=5-LAN new-connection-mark=ADSL-3 per-connection-classifier=both-addresses-and-ports:4/2
/ip firewall mangle add chain=prerouting action=mark-connection dst-address-type=!local in-interface=5-LAN new-connection-mark=ADSL-4 per-connection-classifier=both-addresses-and-ports:4/3

/ip firewall mangle add chain=prerouting action=mark-routing connection-mark=ADSL-1 in-interface=5-LAN new-routing-mark=toADSL-1
/ip firewall mangle add chain=prerouting action=mark-routing connection-mark=ADSL-2 in-interface=5-LAN new-routing-mark=toADSL-2
/ip firewall mangle add chain=prerouting action=mark-routing connection-mark=ADSL-3 in-interface=5-LAN new-routing-mark=toADSL-3
/ip firewall mangle add chain=prerouting action=mark-routing connection-mark=ADSL-4 in-interface=5-LAN new-routing-mark=toADSL-4

/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-1 routing-mark=toADSL-1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-2 routing-mark=toADSL-2 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-3 routing-mark=toADSL-3 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-3 routing-mark=toADSL-4 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-1 distance=1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-2 distance=1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-3 distance=1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-4 distance=1 check-gateway=ping

/ip firewall nat add chain=srcnat out-interface=PPPoE-1 action=masquerade
/ip firewall nat add chain=srcnat out-interface=PPPoE-2 action=masquerade
/ip firewall nat add chain=srcnat out-interface=PPPoE-3 action=masquerade
/ip firewall nat add chain=srcnat out-interface=PPPoE-4 action=masquerade


# 時區 及 時間伺服器 (clock.stdtime.gov.tw)(tock.stdtime.gov.tw)
/system clock set time-zone-name=Asia/Taipei
/system ntp client set enabled=yes mode=unicast primary-ntp=220.130.158.71 secondary-ntp=220.130.158.72

/system reboot
回覆文章

回到「RouterOS」