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

  • ช่วยทีครับ แยกเน็ตแยกเกม+ครีดอทเอมีปัญหา
    เริ่มโดย noomscom
    Read 7,995 times
0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

 

 
วานผู้รู้ช่วยดูให้หน่อยครับ ว่ามีที่ผิดพลาดตรงไหนบ้าง ติดมาเป็นอาทิตย์ๆแล้ว ไม่ไหวจะเคลียร์

ether1 = ต่อเน็ตแบบ pppoe client (CAT 12m)
ether2 = ต่อเน็ตแบบ dhcp client (True 20m)
ether3 = ว่าง
ether4 = hotspot (10.5.50.1)
ether5 = LAN (192.168.200.3)

CAT ไม่ติ๊ก "Dial On Demand", "Add Default Route", "Use Peer DNS"
True ไม่ติ๊ก "Use Peer DNS", "Use Peer NTP", "Add Default Route"



สคริปเป็นประมาณนี้

/interface bridge
add admin-mac=00:00:00:00:00:00 ageing-time=5m arp=enabled auto-mac=yes \
   comment="" disabled=no forward-delay=15s l2mtu=65535 max-message-age=20s \
   mtu=1500 name=loopback0 priority=0x8000 protocol-mode=none \
   transmit-hold-count=6
สร้าง loopback0 ไว้อันนึง

/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB \
   max-udp-packet-size=512 servers=8.8.8.8

/ip firewall nat
add action=masquerade chain=srcnat comment="masquerade hotspot network" \
   disabled=no src-address=10.5.50.0/24
add action=masquerade chain=srcnat comment="" disabled=no src-address=\
   192.168.200.0/24
add action=masquerade chain=srcnat comment="" disabled=no out-interface=\
   ether2
add action=masquerade chain=srcnat comment="" disabled=no out-interface=\
   pppoe-out1
add action=src-nat chain=srcnat comment=7122 disabled=no dst-address=\
   192.168.200.122 dst-port=7122 protocol=tcp src-address=192.168.200.0/24 \
   to-addresses=192.168.200.3 to-ports=0-65535
add action=dst-nat chain=dstnat comment="IP Public Dota" disabled=no \
   dst-address=110.77.152.42 dst-port=7122 protocol=tcp to-addresses=\
   192.168.200.122 to-ports=7122
add action=src-nat chain=srcnat comment=7123 disabled=no dst-address=\
   192.168.200.123 dst-port=7123 protocol=tcp src-address=192.168.200.0/24 \
   to-addresses=192.168.200.3 to-ports=0-65535
add action=dst-nat chain=dstnat comment="IP Public Dota" disabled=no \
   dst-address=110.77.152.42 dst-port=7123 protocol=tcp to-addresses=\
   192.168.200.123 to-ports=7123
ลองครีดอทเอแค่ 2 เครื่อง

/ip firewall mangle
add action=mark-routing chain=prerouting comment=net disabled=no dst-address=\
   0.0.0.0/0 new-routing-mark=net passthrough=yes src-address=\
   192.168.200.0/24
ให้ทุกอย่างออกสายเน็ต แล้วค่อยมาคัดเข้าสายเกมทีหลัง
add action=mark-routing chain=prerouting comment="### DotA ###" disabled=no \
   dst-address=0.0.0.0/0 dst-port=6001-6300 new-routing-mark=games \
   passthrough=yes protocol=tcp src-address=192.168.200.0/24
add action=mark-routing chain=prerouting comment="" disabled=no dst-address=\
   0.0.0.0/0 dst-port=6001-6300 new-routing-mark=games passthrough=yes \
   protocol=udp src-address=192.168.200.0/24
add action=mark-routing chain=prerouting comment="" disabled=no dst-address=\
   0.0.0.0/0 dst-port=7001-7300 new-routing-mark=games passthrough=yes \
   protocol=tcp src-address=192.168.200.0/24
add action=mark-routing chain=prerouting comment="" disabled=no dst-address=\
   0.0.0.0/0 dst-port=7001-7300 new-routing-mark=games passthrough=yes \
   protocol=udp src-address=192.168.200.0/24
ทำให้ port ที่ใช้เล่นดอทเอ วิ่งเข้าสายเกม

/ip route
add check-gateway=ping comment="" disabled=no distance=1 dst-address=\
   0.0.0.0/0 gateway=192.168.2.1 routing-mark=net scope=30 target-scope=10
อันนี้สายเน็ต
ตรงนี้ถ้าเปลี่ยน gateway เป็น ether2 เน็ตจะเล่นไม่ได้

add check-gateway=ping comment="" disabled=no distance=1 dst-address=\
   0.0.0.0/0 gateway=pppoe-out1 routing-mark=games scope=30 target-scope=10
อันนี้สายเกม
add check-gateway=ping comment="" disabled=no distance=1 dst-address=\
   0.0.0.0/0 gateway="pppoe-out1,pppoe-out1,pppoe-out1,pppoe-out1,pppoe-out1,\
   pppoe-out1,192.168.2.1,192.168.2.1,192.168.2.1,192.168.2.1,(unknown),(unkn\
   own),(unknown),(unknown),(unknown),192.168.2.1" scope=30 target-scope=10
(unknown) ตรงนี้ ถ้าไปดูในส่วนของ ip route มันจะเห็นเป็น "on main reachable ether2"


#Script DotA Auto Change IP Public

/system script
add name=dotaScript policy=\
   ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source=":\
   local addr [/ip address get [/ip address find interface=pppoe-out1] address\
   ]\r\
   \n/ip firewall nat set [/ip firewall nat find comment=\"IP Public Dota\"] d\
   st-address=[:pick \$addr 0 ([:len \$addr]-3)]"
สคริปเปลี่ยน public ip


#Script scheduler Change IP Public 10m

/system scheduler
add comment="" disabled=no interval=10m name=DotA on-event=\
   "/system script run dotaScript" policy=\
   reboot,read,write,policy,test,password,sniff,sensitive start-date=may/10/2011 \
   start-time=12:00:00