Welcome to Sysnet Board คู่มือ การใช้งานอุปกรณ์ Network. Please log in or sign up.
สมาชิกทั้งหมด
17,610
กระทู้ทั้งหมด
10,044
หัวข้อทั้งหมด
4,720

  • หากจะแยก GATE WAY ต้องทำอย่างไรครับ
    เริ่มโดย Wizard
    Read 5,700 times
0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

 

 
หากจะแยก GATE WAY ต้องทำอย่างไรครับ
คือ ผมมี คอม 2 ที่ ตอนนี้ มันออกแบบ LOADBALANCE
ปัญหาคือ เล่นเกมส์ไม่ลื่นครับ
ยากจะแยก เครื่อง ออกคนละ GW เลยทำอย่างไรครับ
เครื่องที่บ้าน ไว้ดูหนัง โหลดหนัง     ต้องการให้ LOAD BALANCE
เครื่องที่ร้าน  ไว้เล่นเกมส์             ต้องการให้ ออก  GATE WAY 2


ตอนนี้  ทำแบบนี้ไว้ครับ แก้ตรงไหนดีครับ มันออกทั้ง 2GW

admin@MikroTik] > export compact
# apr/24/2017 21:14:55 by RouterOS 6.38.5
#
#
/interface bridge
add arp=proxy-arp name=bridge1
/interface ethernet
set [ find default-name=ether1 ] arp=proxy-arp
set [ find default-name=ether2 ] arp=proxy-arp
set [ find default-name=ether3 ] arp=proxy-arp comment="Bridge Local"
set [ find default-name=ether5 ] arp=proxy-arp master-port=ether3
set [ find default-name=ether6 ] arp=proxy-arp disabled=yes
set [ find default-name=ether7 ] disabled=yes
set [ find default-name=ether8 ] disabled=yes
set [ find default-name=ether9 ] disabled=yes
set [ find default-name=ether10 ] disabled=yes
set [ find default-name=sfp1 ] disabled=yes
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 max-mru=1492 max-mtu=\
   1492 name=pppoe-out1 password=999999 service-name=CAT use-peer-dns=yes user=\
   cdno04346666@onnet.s
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-eC \
   country="united states" disabled=no frequency=auto mode=ap-bridge ssid=\
   EAK_WIFI wireless-protocol=802.11
/interface ethernet switch port
set 6 default-vlan-id=0
set 7 default-vlan-id=0
set 8 default-vlan-id=0
set 9 default-vlan-id=0
set 10 default-vlan-id=0
set 12 default-vlan-id=0
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk group-ciphers=\
   tkip,aes-ccm mode=dynamic-keys unicast-ciphers=tkip,aes-ccm \
   wpa-pre-shared-key=1111100000 wpa2-pre-shared-key=1111100000
/ip pool
add name=dhcp ranges=192.168.1.200-192.168.1.210
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge1 name="ip switch1"
/ppp profile
add local-address=192.168.1.250 name=PPTP1 remote-address=dhcp use-encryption=\
   yes
/queue simple
add burst-limit=30M/120M burst-threshold=20M/40M burst-time=20s/40s max-limit=\
   20M/100M name=100 packet-marks=no-mark priority=1/1 target=192.168.1.100/32
add burst-limit=40M/140M burst-threshold=20M/40M burst-time=20s/40s max-limit=\
   20M/100M name=101 packet-marks=no-mark priority=2/2 target=192.168.1.101/32
add burst-limit=30M/50M burst-threshold=10M/20M burst-time=20s/20s max-limit=\
   20M/45M name=102 packet-marks=no-mark priority=4/4 target=192.168.1.102/32
add burst-limit=30M/80M burst-threshold=15M/30M burst-time=20s/20s max-limit=\
   20M/70M name=103 packet-marks=no-mark priority=4/4 target=192.168.1.103/32
add burst-limit=30M/50M burst-threshold=10M/10M burst-time=20s/20s max-limit=\
   20M/50M name=104 packet-marks=no-mark target=192.168.1.104/32
add burst-limit=30M/50M burst-threshold=10M/10M burst-time=20s/20s max-limit=\
   20M/40M name=105 packet-marks=no-mark target=192.168.1.105/32
add burst-limit=30M/100M burst-threshold=20M/30M burst-time=20s/20s max-limit=\
   20M/70M name=106 packet-marks=no-mark priority=2/2 target=192.168.1.106/32
add burst-limit=20M/70M burst-threshold=15M/20M burst-time=20s/20s max-limit=\
   15M/60M name=107 packet-marks=no-mark target=192.168.1.107/32
add burst-limit=20M/20M burst-threshold=10M/10M burst-time=20s/20s max-limit=\
   10M/10M name=108 target=192.168.1.108/32
add burst-limit=20M/20M burst-threshold=10M/10M burst-time=20s/20s max-limit=\
   10M/10M name=109 target=192.168.1.109/32
add burst-limit=20M/20M burst-threshold=10M/10M burst-time=20s/20s max-limit=\
   10M/10M name=110 target=192.168.1.110/32
/interface bridge port
add bridge=bridge1 interface=sfp1
add bridge=bridge1 interface=wlan1
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add interface=ether6
add interface=ether7
add interface=ether8
add interface=ether9
add interface=ether10
/interface pptp-server server
set authentication=pap,chap,mschap1,mschap2 default-profile=default enabled=yes \
   max-mru=1472 max-mtu=1472
/ip address
add address=192.168.1.250/24 comment=LAN interface=ether3 network=192.168.1.0
add address=192.168.2.252/24 comment=3BB interface=ether2 network=192.168.2.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add dhcp-options=hostname,clientid interface=ether1
/ip dhcp-server lease
add address=192.168.1.110 client-id=1:48:2:2a:e1:a8:7c mac-address=\
   48:02:2A:E1:A8:7C server="ip switch1"
add address=192.168.1.109 client-id=1:48:2:2a:e1:97:54 mac-address=\
   48:02:2A:E1:97:54 server="ip switch1"
/ip dhcp-server network
add address=192.168.1.0/24 gateway=192.168.1.250 netmask=24
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip firewall address-list
add address=192.168.1.106 list=192.168.1.106
add address=192.168.1.100 list=192.168.1.100
add address=192.168.1.251 list=192.168.1.251
add address=192.168.1.102 list=102
add address=192.168.1.105 list=105
/ip firewall mangle
add action=accept chain=prerouting comment="loadbalance Rule" dst-address=\
   192.168.2.0/24
add action=mark-connection chain=prerouting connection-mark=no-mark \
   in-interface=ether2 new-connection-mark=wan2_con passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
   in-interface=pppoe-out1 new-connection-mark=wan1_con passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
   dst-address-type=!local in-interface=bridge1 new-connection-mark=wan1_con \
   passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1
add action=mark-connection chain=prerouting connection-mark=no-mark \
   dst-address-type=!local in-interface=bridge1 new-connection-mark=wan2_con \
   passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-routing chain=prerouting connection-mark=wan1_con in-interface=\
   bridge1 new-routing-mark=to_wan1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=wan2_con in-interface=\
   bridge1 new-routing-mark=to_wan2 passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
   dst-address-type=!local in-interface=ether6 new-connection-mark=wan1_con \
   passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1
add action=mark-connection chain=prerouting connection-mark=no-mark \
   dst-address-type=!local in-interface=ether6 new-connection-mark=wan2_con \
   passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-routing chain=prerouting connection-mark=wan1_con in-interface=\
   ether6 new-routing-mark=to_wan1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=wan2_con in-interface=\
   ether6 new-routing-mark=to_wan2 passthrough=yes
add action=mark-routing chain=output connection-mark=wan1_con new-routing-mark=\
   to_wan1 passthrough=yes
add action=mark-routing chain=output connection-mark=wan2_con new-routing-mark=\
   to_wan2 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=pppoe-out1
add action=masquerade chain=srcnat out-interface=ether2
add action=accept chain=dstnat dst-address=192.168.1.250 dst-port=1723 \
   in-interface=pppoe-out1 protocol=tcp
add action=accept chain=dstnat dst-address=192.168.1.250 dst-port=8291 \
   in-interface=pppoe-out1 protocol=tcp to-addresses=192.168.1.250 to-ports=\
   8291
/ip route
add check-gateway=ping distance=1 gateway=pppoe-out1 routing-mark=to_wan1
add check-gateway=ping distance=1 gateway=pppoe-out1 routing-mark=to_wan1
add check-gateway=ping distance=2 gateway=192.168.2.250 routing-mark=to_wan2
add check-gateway=ping distance=2 gateway=192.168.2.250 routing-mark=to_wan2
/ip service
set telnet disabled=yes
set ftp disabled=yes
set ssh disabled=yes
set www-ssl disabled=no
set api disabled=yes
set api-ssl disabled=yes
/ppp secret
add name=smf01 password=1232132123133232 profile=PPTP1
/system clock
set time-zone-name=Asia/Bangkok
/system clock manual
set time-zone=+07:00
/system logging
set 0 action=remote disabled=yes
set 1 action=remote disabled=yes
set 2 action=remote disabled=yes
set 3 action=remote disabled=yes
/system ntp client
set enabled=yes primary-ntp=172.24.16.1 secondary-ntp=125.26.65.36
/system scheduler
add comment="Update No-IP DDNS" interval=5m10s name=no-ip_ddns_update on-event=\
   no-ip_ddns_update policy=read,write,test start-time=startup
add comment="Update No-IP DDNS" interval=5m10s name=no-ip_ddns_update2 \
   on-event=no-ip_ddns_update2 policy=read,write,test start-time=startup
/system script
add name=no-ip_ddns_update owner=admin policy=read,write,test source="# No-IP au\
   tomatic Dynamic DNS update\r\
   \n\r\
   \n#--------------- Change Values in this section to match your setup -------\
   -----------\r\
   \n\r\
   \n# No-IP User account info\r\
   \n:local noipuser \"xxxxxxxx xzxxxx1\"\r\
   \n:local noippass \"zxzxzxzxzxzx\"\r\
   \n\r\
   \n# Set the hostname or label of network to be updated.\r\
   \n# Hostnames with spaces are unsupported. Replace the value in the quotatio\
   ns below with your host names.\r\
   \n# To specify multiple hosts, separate them with commas.\r\
   \n:local noiphost \"zxzxzx.xzczc.com\"\r\
   \n\r\
   \n# Change to the name of interface that gets the dynamic IP address\r\
   \n:local inetinterface \"ether1\"\r\
   \n\r\
   \n#-------------------------------------------------------------------------\
   -----------\r\
   \n# No more changes need\r\
   \n\r\
   \n:global previousIP\r\
   \n\r\
   \n:if ([/interface get \$inetinterface value-name=running]) do={\r\
   \n# Get the current IP on the interface\r\
   \n   :local currentIP [/ip address get [find interface=\"\$inetinterface\" d\
   isabled=no] address]\r\
   \n\r\
   \n# Strip the net mask off the IP address\r\
   \n   :for i from=( [:len \$currentIP] - 1) to=0 do={\r\
   \n       :if ( [:pick \$currentIP \$i] = \"/\") do={ \r\
   \n           :set currentIP [:pick \$currentIP 0 \$i]\r\
   \n       } \r\
   \n   }\r\
   \n\r\
   \n   :if (\$currentIP != \$previousIP) do={\r\
   \n       :log info \"No-IP: Current IP \$currentIP is not equal to previous \
   IP, update needed\"\r\
   \n       :set previousIP \$currentIP\r\
   \n\r\
   \n# The update URL. Note the \"\\3F\" is hex for question mark (\?). Require\
   d since \? is a special character in commands.\r\
   \n       :local url \"http://dynupdate.no-ip.com/nic/update\\3Fmyip=\$curren\
   tIP\"\r\
   \n       :local noiphostarray\r\
   \n       :set noiphostarray [:toarray \$noiphost]\r\
   \n       :foreach host in=\$noiphostarray do={\r\
   \n           :log info \"No-IP: Sending update for \$host\"\r\
   \n           /tool fetch url=(\$url . \"&hostname=\$host\") user=\$noipuser \
   password=\$noippass mode=http dst-path=(\"no-ip_ddns_update-\" . \$host . \"\
   .txt\")\r\
   \n           :log info \"No-IP: Host \$host updated on No-IP with IP \$curre\
   ntIP\"\r\
   \n       }\r\
   \n   }  else={\r\
   \n       :log info \"No-IP: Previous IP \$previousIP is equal to current IP,\
   \_no update needed\"\r\
   \n   }\r\
   \n} else={\r\
   \n   :log info \"No-IP: \$inetinterface is not currently running, so therefo\
   re will not update.\"\r\
   \n}"
add name=no-ip_ddns_update2 owner=admin policy=read,write,test source="# No-ip D\
   NS control automatic updates\r\
   \n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\
   \n# EDIT YOUR DETAILS / CONFIGURATION HERE\r\
   \n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\
   \n:local username \"xcxcxc1211\"\r\
   \n:local password \"cxcxc44540\"\r\
   \n:local theinterface \"ether2\"\r\
   \n:local hostname \"sdfdf.dfdf.com\"\r\
   \n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\
   \n# END OF USER DEFINED CONFIGURATION\r\
   \n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\
   \n\r\
   \n:global dyndnsForce\r\
   \n:global previousIP\r\
   \n\r\
   \n# print some debug info\r\
   \n#:log info (\"No-IPddns-update: username = \$username\")\r\
   \n#:log info (\"No-IPddns-update: password = \$password\")\r\
   \n#:log info (\"No-IPddns-update: hostname = \$hostname\")\r\
   \n#:log info (\"No-IPddns-update: previousIP = \$previousIP\")\r\
   \n\r\
   \n# get the current IP address from the internet (in case of double-nat)\r\
   \n/tool fetch mode=http address=\"checkip.dyndns.org\" src-path=\"/\" dst-pa\
   th=\"/dyndns.checkip.html\"\r\
   \n:local result [/file get dyndns.checkip.html contents]\r\
   \n\r\
   \n# parse the current IP result\r\
   \n:local resultLen [:len \$result]\r\
   \n:local startLoc [:find \$result \": \" -1]\r\
   \n:set startLoc (\$startLoc + 2)\r\
   \n:local endLoc [:find \$result \"</body>\" -1]\r\
   \n:local currentIP [:pick \$result \$startLoc \$endLoc]\r\
   \n:log info \"dyndns-update: currentIP = \$currentIP\"\r\
   \n\r\
   \n# Determine if dyndns update is needed\r\
   \n# more dyndns updater request details available at http://www.dyndns.com/d\
   evelopers/specs/syntax.html\r\
   \n:if ((\$currentIP != \$previousIP) || (\$dyndnsForce = true)) do={\r\
   \n    :set dyndnsForce false\r\
   \n    :set previousIP \$currentIP\r\
   \n    /tool fetch user=\$username password=\$password mode=http address=\"dy\
   nupdate.no-ip.com\" src-path=\"/nic/update\?hostname=\$hostname&myip=\$curre\
   ntIP\"\r\
   \n    :local result [/file get dyndns.txt contents]\r\
   \n    :log info (\"No-IPddns-update: No-IPddns update needed\")\r\
   \n    :log info (\"No-IPddns-update: No-IPddns Update Result: \".\$result)\r\
   \n    :put (\"No-IPddns Update Result: \".\$result)\r\
   \n} else={\r\
   \n    :log info (\"No-IPddns-update: No No-IPddns update needed\")\r\
   \n}\r\
   \n}"
/system watchdog
set no-ping-delay=10m watch-address=8.8.8.8
/tool graphing interface
add allow-address=172.24.0.0/13
[admin
@Mikro