Community discussions

MikroTik App
 
maximusmx
just joined
Topic Author
Posts: 10
Joined: Tue Oct 05, 2021 4:34 am

PPC Script conversion

Fri Oct 22, 2021 6:47 pm

Hello,
Could some body convert my script to v7? I got difficult for
/ip route that couldn't let pppoe interface work
Thanks in advanced.
/interface bridge
add name=bridge1
/interface wireless
set [ find default-name=wlan1 ] ssid=MikroTik
/interface ethernet
set [ find default-name=ether1 ] comment="WAN 1-ISP1"
set [ find default-name=ether2 ] comment="WAN 2-ISP2"
set [ find default-name=ether3 ] comment="Bridge 1 - Eth 3/4"
/interface pppoe-client
add add-default-route=yes default-route-distance=3 disabled=no interface=\
    ether1 name=pppoe-out1 password=123456 user=ISP1
add add-default-route=yes default-route-distance=2 disabled=no interface=\
    ether2 name=pppoe-out2 password=123456 user=ISP2
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool0 ranges=192.168.100.2-192.168.100.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=bridge1 name=dhcp1
/interface bridge port
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
/ip address
add address=192.168.100.1/24 interface=bridge1 network=192.168.100.0
/ip dhcp-server lease
add address=192.168.100.200 client-id=1:18:f:76:fa:bc:8f mac-address=\
    18:0F:76:FA:BC:8F server=dhcp1
/ip dhcp-server network
add address=192.168.100.0/24 gateway=192.168.100.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip firewall mangle
add action=mark-connection chain=prerouting comment=#MarkInputWan \
    connection-mark=no-mark in-interface=pppoe-out1 new-connection-mark=\
    wan1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    in-interface=pppoe-out2 new-connection-mark=wan2_conn passthrough=yes
add action=mark-connection chain=prerouting comment=#LoadbalanceLAN \
    connection-mark=no-mark dst-address-type=!local in-interface=bridge1 \
    new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=\
    src-address:2/0
add action=mark-connection chain=prerouting connection-mark=no-mark \
    dst-address-type=!local in-interface=bridge1 new-connection-mark=\
    wan2_conn passthrough=yes per-connection-classifier=src-address:2/1
add action=mark-routing chain=prerouting comment=#MarkInputLAN \
    connection-mark=wan1_conn in-interface=bridge1 new-routing-mark=to_wan1 \
    passthrough=yes
add action=mark-routing chain=prerouting connection-mark=wan2_conn \
    in-interface=bridge1 new-routing-mark=to_wan2 passthrough=yes
add action=mark-routing chain=output comment=#MarkOutputRouting \
    connection-mark=wan1_conn new-routing-mark=to_wan1 passthrough=yes
add action=mark-routing chain=output connection-mark=wan2_conn \
    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=pppoe-out2
/ip route
add check-gateway=ping distance=1 gateway=pppoe-out1 routing-mark=to_wan1
add check-gateway=ping distance=1 gateway=pppoe-out2 routing-mark=to_wan2
add check-gateway=ping distance=1 gateway=pppoe-out1
add check-gateway=ping distance=2 gateway=pppoe-out2
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set api disabled=yes
set winbox port=9090
set api-ssl disabled=yes
/system clock
set time-zone-name=Asia/Bangkok

Who is online

Users browsing this forum: No registered users and 10 guests