Community discussions

MikroTik App
 
datalinux
just joined
Topic Author
Posts: 10
Joined: Fri Jul 08, 2005 10:15 pm

PCC bridge adsl

Mon May 17, 2010 12:25 am

Hello,
Please check if this script has errors. It is possible to use the same computer with hotspot.

/ interface
set ether2 name=EthLinkA
set ether3 name=EthLinkB
set ether4 name=EthLinkC
set ether9 name=EthClients

/ ip address
add address=192.168.160.1/21 network=192.168.160.0 broadcast=192.168.167.255 interface=EthClients
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=EthLinkA
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=EthLinkB
add address=10.113.0.2/24 network=10.113.0.0 broadcast=10.113.0.255 interface=EthLinkC

/ ip firewall mangle
add action=accept chain=prerouting comment="NO BALANCE" dst-address-list=no_balance in-interface=EthClients

add action=mark-connection chain=input connection-state=new in-interface=EthLinkA new-connection-mark=conn_na
add action=mark-connection chain=input connection-state=new in-interface=EthLinkB new-connection-mark=conn_nb
add action=mark-connection chain=input connection-state=new in-interface=EthLinkC new-connection-mark=conn_nc

add action=mark-routing chain=output connection-mark=conn_na new-routing-mark=to_ra passthrough=no
add action=mark-routing chain=output connection-mark=conn_nb new-routing-mark=to_rb passthrough=no
add action=mark-routing chain=output connection-mark=conn_nc new-routing-mark=to_rc passthrough=no

add action=mark-connection chain=prerouting dst-address-type=!local in-interface=EthClients new-connection-mark=conn_ma0 per-connection-classifier=both-addresses:3/0
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=EthClients new-connection-mark=conn_mb1 per-connection-classifier=both-addresses:3/1
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=EthClients new-connection-mark=conn_mc2 per-connection-classifier=both-addresses:3/2

add action=mark-routing chain=prerouting connection-mark=conn_ma0 in-interface=EthClients new-routing-mark=to_nra passthrough=no
add action=mark-routing chain=prerouting connection-mark=conn_mb1 in-interface=EthClients new-routing-mark=to_nrb passthrough=no
add action=mark-routing chain=prerouting connection-mark=conn_mc2 in-interface=EthClients new-routing-mark=to_nrc passthrough=no

/ ip firewall nat
add action=masquerade chain=srcnat src-address=192.168.160.1/21 comment="MASC PCC"

/ interface pppoe-client
add add-default-route=no interface=EthLinkA name=pppoe-LinkA password=1234 use-peer-dns=no user=username@username disabled=no
add add-default-route=no interface=EthLinkB name=pppoe-LinkB password=1234 use-peer-dns=no user=username@username disabled=no
add add-default-route=no interface=EthLinkC name=pppoe-LinkC password=1234 use-peer-dns=no user=username@username disabled=no

/ ip route
add distance=2 dst-address=0.0.0.0/0 gateway=pppoe-LinkA scope=30 target-scope=10
add distance=3 dst-address=0.0.0.0/0 gateway=pppoe-LinkB scope=30 target-scope=10
add distance=4 dst-address=0.0.0.0/0 gateway=pppoe-LinkC scope=30 target-scope=10

add distance=1 dst-address=0.0.0.0/0 gateway=pppoe-LinkA routing-mark=to_nra
add distance=1 dst-address=0.0.0.0/0 gateway=pppoe-LinkB routing-mark=to_nrb
add distance=1 dst-address=0.0.0.0/0 gateway=pppoe-LinkC routing-mark=to_nrc