返回列表 發帖

dual wan v6 想改造成 v7 可用

想請教下
目前用緊 雙4G Wan DHCP, failover + PCC
發現個code用唔到係v7 上面... 想請教下 點樣修改可以用係ros v7上面?

請各位高手指導
  1. /interface bridge add name=bridge

  2. /interface bridge port
  3. add bridge=bridge interface=ether3
  4. add bridge=bridge interface=ether2
  5. add bridge=bridge interface=ether1

  6. /interface list
  7. add comment=defconf name=WAN
  8. add comment=defconf name=LAN

  9. /interface list member
  10. add interface=bridge list=LAN
  11. add interface=ether5 list=WAN
  12. add interface=ether4 list=WAN


  13. /interface detect-internet set internet-interface-list=WAN lan-interface-list=LAN wan-interface-list=WAN

  14. /ip upnp
  15. set enabled=yes
  16. /ip upnp interfaces
  17. add interface=bridge type=internal
  18. add interface=ether5 type=external
  19. add interface=ether4 type=external


  20. /ip settings
  21. set allow-fast-path=no

  22. /ip address add address=192.168.88.1/24 interface=bridge network=192.168.88.0

  23. /ip firewall address-list add address=192.168.88.0/24 list=local

  24. /ip firewall nat
  25. add action=masquerade chain=srcnat ipsec-policy=out,none out-interface-list=WAN

  26. /ip firewall mangle
  27. add action=accept chain=prerouting comment="bridge access" dst-address-list=local in-interface=bridge
  28. add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether4 new-connection-mark=CONN2 passthrough=yes
  29. add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether5 new-connection-mark=CONN1 passthrough=yes
  30. add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge new-connection-mark=CONN1 passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0
  31. add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge new-connection-mark=CONN2 passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1
  32. add action=mark-routing chain=prerouting connection-mark=CONN1 in-interface=bridge new-routing-mark=ISP1 passthrough=yes
  33. add action=mark-routing chain=prerouting connection-mark=CONN2 in-interface=bridge new-routing-mark=ISP2 passthrough=yes
  34. add action=mark-routing chain=output connection-mark=CONN1 new-routing-mark=ISP1 passthrough=yes
  35. add action=mark-routing chain=output connection-mark=CONN2 new-routing-mark=ISP2 passthrough=yes


  36. /routing filter
  37. add chain=dynamic-in distance=33 set-distance=2 set-route-comment=ISP2 set-scope=10
  38. add chain=dynamic-in distance=34 set-distance=3 set-route-comment=ISP1 set-scope=10

  39. /ip dhcp-client
  40. add default-route-distance=33 disabled=no interface=ether4 script="{\
  41.     \n    :if (\$bound=1) do={\
  42.     \n        /ip route set [/ip route find where comment=\"ISP2_VALIDATE\"] gateway=\$\"gateway-address\"\
  43.     \n    } \
  44.     \n    /ip firewall connection remove [find connection-mark=\"CONN1\"]\
  45.     \n    /ip firewall connection remove [find connection-mark=\"CONN2\"]\
  46.     \n}" use-peer-dns=no use-peer-ntp=no
  47. add default-route-distance=32 disabled=no interface=ether5 script="{\
  48.     \n    :if (\$bound=1) do={\
  49.     \n        /ip route set [/ip route find where comment=\"ISP1_VALIDATE\"] gateway=\$\"gateway-address\"\
  50.     \n    } \
  51.     \n    /ip firewall connection remove [find connection-mark=\"CONN1\"]\
  52.     \n    /ip firewall connection remove [find connection-mark=\"CONN2\"]\
  53.     \n}" use-peer-dns=no use-peer-ntp=no

  54. /ip route
  55. add comment=ISP1_VALIDATE distance=1 dst-address=185.228.168.9/32 gateway=127.0.0.1 scope=10
  56. add comment=ISP1_VALIDATE distance=1 dst-address=208.67.220.220/32 gateway=127.0.0.1 scope=10
  57. add comment=ISP1_VALIDATE distance=1 dst-address=208.67.222.222/32 gateway=127.0.0.1 scope=10
  58. add comment=ISP2_VALIDATE distance=1 dst-address=94.140.14.14/32 gateway=127.0.0.1 scope=10
  59. add comment=ISP2_VALIDATE distance=1 dst-address=94.140.15.15/32 gateway=127.0.0.1 scope=10
  60. add comment=ISP2_VALIDATE distance=1 dst-address=8.20.247.20/32 gateway=127.0.0.1 scope=10
  61. add check-gateway=ping distance=1 dst-address=10.1.1.1/32 gateway=185.228.168.9 scope=10
  62. add check-gateway=ping distance=1 dst-address=10.1.1.1/32 gateway=208.67.220.220 scope=10
  63. add check-gateway=ping distance=1 dst-address=10.1.1.1/32 gateway=208.67.222.222 scope=10
  64. add check-gateway=ping distance=1 dst-address=10.2.2.1/32 gateway=94.140.14.14 scope=10
  65. add check-gateway=ping distance=1 dst-address=10.2.2.1/32 gateway=94.140.15.15 scope=10
  66. add check-gateway=ping distance=1 dst-address=10.2.2.1/32 gateway=8.20.247.20 scope=10
  67. add distance=1 gateway=10.1.1.1 routing-mark=ISP1
  68. add distance=2 gateway=10.2.2.1 routing-mark=ISP1
  69. add distance=1 gateway=10.2.2.1 routing-mark=ISP2
  70. add distance=2 gateway=10.1.1.1 routing-mark=ISP2
  71. add distance=20 dst-address=185.228.168.9/32 type=blackhole
  72. add distance=20 dst-address=208.67.220.220/32 type=blackhole
  73. add distance=20 dst-address=208.67.222.222/32 type=blackhole
  74. add distance=20 dst-address=94.140.14.14/32 type=blackhole
  75. add distance=20 dst-address=94.140.15.15/32 type=blackhole
  76. add distance=20 dst-address=8.20.247.20/32 type=blackhole
複製代碼

原来V6版本的教程、命令、界面按钮 有些与V7版本已经不太一样了。

TOP

那唯有繼續用6.48.6吧

TOP

返回列表