Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /ppp profile
- set *0 remote-address=192.168.99.1
- add comment="for PPPoE to ISP1" interface-list=WAN name=isp1_client on-down="/\
- ip firewall nat remove [find comment=\"NAT via ISP1\"];\r\
- \n/ip route remove [find comment=\"For recursion via ISP1\"];\r\
- \n/ip route remove [find comment=\"Unmarked via ISP1\"];\r\
- \n/ip route remove [find comment=\"Marked via ISP1 Main\"];\r\
- \n/ip route remove [find comment=\"Marked via ISP2 Backup1\"];\r\
- \n/ip route rule set [find comment=\"From ISP1 IP to Inet\"] disabled=yes;\
- " on-up="/ip route add check-gateway=ping comment=\"For recursion via ISP1\
- \" distance=1 dst-address=4.2.2.1/32 gateway=\$\"remote-address\" scope=10\
- \r\
- \n/ip route add check-gateway=ping comment=\"Unmarked via ISP1\" distance=\
- 1 gateway=4.2.2.1;\r\
- \n/ip route add comment=\"Marked via ISP1 Main\" distance=1 gateway=4.2.2.\
- 1 routing-mark=to_isp1;\r\
- \n/ip route add comment=\"Marked via ISP2 Backup1\" distance=1 gateway=4.2\
- .2.1 routing-mark=to_isp2;\r\
- \n/ip firewall mangle set [find comment=\"Connmark in from ISP1\"] in-inte\
- rface=\$\"interface\";\r\
- \n/ip firewall nat add action=src-nat chain=srcnat ipsec-policy=out,none o\
- ut-interface=\$\"interface\" to-addresses=\$\"local-address\" comment=\"NA\
- T via ISP1\" place-before=0;\r\
- \nif ([/ip route rule find comment=\"From ISP1 IP to Inet\"] =\"\") do={\r\
- \n /ip route rule add comment=\"From ISP1 IP to Inet\" src-address=\$\"l\
- ocal-address\" table=to_isp1 \r\
- \n} else={\r\
- \n /ip route rule set [find comment=\"From ISP1 IP to Inet\"] disabled=n\
- o src-address=\$\"local-address\"\r\
- \n};\r\
- \n"
- add comment="for PPPoE to ISP2" interface-list=WAN name=isp2_client on-down="/\
- ip firewall nat remove [find comment=\"NAT via ISP2\"];\r\
- \n/ip route remove [find comment=\"For recursion via ISP2\"];\r\
- \n/ip route remove [find comment=\"Unmarked via ISP2\"];\r\
- \n/ip route remove [find comment=\"Marked via ISP2 Main\"];\r\
- \n/ip route remove [find comment=\"Marked via ISP1 Backup2\"];\r\
- \n/ip route rule set [find comment=\"From ISP2 IP to Inet\"] disabled=yes;\
- " on-up="/ip route add check-gateway=ping comment=\"For recursion via ISP2\
- \" distance=1 dst-address=4.2.2.2/32 gateway=\$\"remote-address\" scope=10\
- \r\
- \n/ip route add check-gateway=ping comment=\"Unmarked via ISP2\" distance=\
- 2 gateway=4.2.2.2;\r\
- \n/ip route add comment=\"Marked via ISP2 Main\" distance=1 gateway=4.2.2.\
- 2 routing-mark=to_isp2;\r\
- \n/ip route add comment=\"Marked via ISP1 Backup2\" distance=2 gateway=4.2\
- .2.2 routing-mark=to_isp1;\r\
- \n/ip firewall mangle set [find comment=\"Connmark in from ISP2\"] in-inte\
- rface=\$\"interface\";\r\
- \n/ip firewall nat add action=src-nat chain=srcnat ipsec-policy=out,none o\
- ut-interface=\$\"interface\" to-addresses=\$\"local-address\" comment=\"NA\
- T via ISP2\" place-before=0;\r\
- \nif ([/ip route rule find comment=\"From ISP2 IP to Inet\"] =\"\") do={\r\
- \n /ip route rule add comment=\"From ISP2 IP to Inet\" src-address=\$\"l\
- ocal-address\" table=to_isp2 \r\
- \n} else={\r\
- \n /ip route rule set [find comment=\"From ISP2 IP to Inet\"] disabled=n\
- o src-address=\$\"local-address\"\r\
- \n};"
- ===
- /interface pppoe-client
- add comment="to ISP2" disabled=no interface=ether2 name=pppoe-ISP2 \
- profile=isp2_client user=user2
- add comment="to ISP1" disabled=no interface=ether1 max-mtu=1480 name=\
- pppoe-ISP1 profile=isp1_client user=user1
- ===
- /ip route
- add comment="Marked via ISP2 Backup1" distance=1 gateway=4.2.2.1 \
- routing-mark=to_isp2
- add comment="Marked via ISP2 Main" distance=1 gateway=4.2.2.2 routing-mark=\
- to_isp2
- add comment="Marked via ISP1 Main" distance=1 gateway=4.2.2.1 routing-mark=\
- to_isp1
- add comment="Marked via ISP1 Backup2" distance=2 gateway=4.2.2.2 \
- routing-mark=to_isp1
- add check-gateway=ping comment="Unmarked via ISP1" distance=1 gateway=4.2.2.1
- add check-gateway=ping comment="Unmarked via ISP2" distance=2 gateway=4.2.2.2
- add check-gateway=ping comment="For recursion via ISP1" distance=1 \
- dst-address=4.2.2.1/32 gateway=192.168.40.1 scope=10
- add check-gateway=ping comment="For recursion via ISP2" distance=1 \
- dst-address=4.2.2.2/32 gateway=10.1.3.49 scope=10
- /ip route rule
- add comment="From ISP1 IP to Inet" src-address=10.1.24.90/32 table=to_isp1
- add comment="From ISP2 IP to Inet" src-address=10.77.156.61/32 table=to_isp2
Advertisement
Add Comment
Please, Sign In to add comment