Community discussions

MikroTik App
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

change multi WAN Mikrotik router setting if modems bridgei

Sat Oct 15, 2011 1:19 am

I have Mikrotik routerOS v5.7 and I am using the fallowing code to combine three line
/ip firewall address-list
add list=exempt-from-pcc address=192.168.9.168/32
add list=exempt-from-pcc address=192.168.3.168/32
add list=exempt-from-pcc address=192.168.11.168/32
/ip firewall mangle
add chain=prerouting dst-address-list=exempt-from-pcc action=accept


/ip address
add address=192.168.9.60/24 broadcast=192.168.9.255 comment="" disabled=no interface=wan1 network=192.168.9.0
add address=192.168.3.60/24 broadcast=192.168.3.255 comment="" disabled=no interface=wan2 network=192.168.3.0
add address=192.168.11.60/24 broadcast=192.168.11.255 comment="" disabled=no interface=wan3 network=192.168.11.0
add address=192.168.1.168/24 broadcast=192.168.1.255 comment="" disabled=no interface=lan network=192.168.1.0
/ip firewall mangle
add action=mark-connection chain=input comment="" disabled=no in-interface=wan1 new-connection-mark=wan1_conn passthrough=yes    
add action=mark-connection chain=input comment="" disabled=no in-interface=wan2 new-connection-mark=wan2_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=wan3 new-connection-mark=wan3_conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=wan1_conn disabled=no new-routing-mark=wan1 passthrough=yes    
add action=mark-routing chain=output comment="" connection-mark=wan2_conn disabled=no new-routing-mark=wan2 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=wan3_conn disabled=no new-routing-mark=wan3 passthrough=yes
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0  
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan2_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan3_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2
add action=mark-routing chain=prerouting comment="" connection-mark=wan1_conn disabled=no in-interface=lan new-routing-mark=wan1 passthrough=yes    
add action=mark-routing chain=prerouting comment="" connection-mark=wan2_conn disabled=no in-interface=lan new-routing-mark=wan2 passthrough=yes
add action=mark-routing chain=prerouting comment="" connection-mark=wan3_conn disabled=no in-interface=lan new-routing-mark=wan3 passthrough=yes    
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.9.168 routing-mark=wan1 scope=30 target-scope=10    
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.3.168 routing-mark=wan2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.11.168 routing-mark=wan3 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.9.168 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=192.168.3.168 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=3 dst-address=0.0.0.0/0 gateway=192.168.11.168 scope=30 target-scope=10
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=wan1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=wan2
add action=masquerade chain=srcnat comment="" disabled=no out-interface=wan3
/ip dns set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 

what line I need to disable and what one to add if I want to change the three ADSL modems to bridge mode so Mikrotik router get the public IP from ISP.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: change multi WAN Mikrotik router setting if modems bridg

Sat Oct 15, 2011 2:14 am

You set the modem to bridge mode, set up PPPoE clients on the three interfaces (http://wiki.mikrotik.com/wiki/Manual:In ... PoE_Client) and replace the references to the WAN interfaces and WAN ranges with the new information. You'd also replace the gateways of the routes with the interface names (for point to point links like PPPoE connections you can refer to interfaces instead of IPs). I can't be more specific because you choose the WAN interface names, and we can't possible know the IP address ranges they use to assign addresses.
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

Re: change multi WAN Mikrotik router setting if modems bridg

Sat Oct 15, 2011 8:45 am

after creating pppoe clients for each wan port, should I change all the interfaces and gateways setting it as the fallowing
/ip firewall address-list
add list=exempt-from-pcc address=192.168.9.168/32
add list=exempt-from-pcc address=192.168.3.168/32
add list=exempt-from-pcc address=192.168.11.168/32
/ip firewall mangle
add chain=prerouting dst-address-list=exempt-from-pcc action=accept


/ip address
add address=192.168.9.60/24 broadcast=192.168.9.255 comment="" disabled=no interface=wan1 network=192.168.9.0
add address=192.168.3.60/24 broadcast=192.168.3.255 comment="" disabled=no interface=wan2 network=192.168.3.0
add address=192.168.11.60/24 broadcast=192.168.11.255 comment="" disabled=no interface=wan3 network=192.168.11.0
add address=192.168.1.168/24 broadcast=192.168.1.255 comment="" disabled=no interface=lan network=192.168.1.0
/ip firewall mangle
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe1 new-connection-mark=wan1_conn passthrough=yes   
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe2 new-connection-mark=wan2_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe3 new-connection-mark=wan3_conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=wan1_conn disabled=no new-routing-mark=wan1 passthrough=yes   
add action=mark-routing chain=output comment="" connection-mark=wan2_conn disabled=no new-routing-mark=wan2 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=wan3_conn disabled=no new-routing-mark=wan3 passthrough=yes
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan2_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan3_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2
add action=mark-routing chain=prerouting comment="" connection-mark=wan1_conn disabled=no in-interface=lan new-routing-mark=wan1 passthrough=yes   
add action=mark-routing chain=prerouting comment="" connection-mark=wan2_conn disabled=no in-interface=lan new-routing-mark=wan2 passthrough=yes
add action=mark-routing chain=prerouting comment="" connection-mark=wan3_conn disabled=no in-interface=lan new-routing-mark=wan3 passthrough=yes   
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe1 routing-mark=wan1 scope=30 target-scope=10   
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe2 routing-mark=wan2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe3 routing-mark=wan3 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=pppoe2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=3 dst-address=0.0.0.0/0 gateway=pppoe3 scope=30 target-scope=10
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe2
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe3
/ip dns set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 
I kept the IPs in the top of the code to enter the modem pages. I need to change to bridge because I have around 30 user online in the same time and they have many connections. I thing the modems doesn't handle many connections at the same time
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

Re: change multi WAN Mikrotik router setting if modems bridg

Sun Oct 16, 2011 6:49 am

after the change, it seems that I can no access the modem pages. what should I do?

Note: when I connect to the modem directly I can acess the modem page ( for example modem 1 : 192.168.9.168)
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

Re: change multi WAN Mikrotik router setting if modems bridg

Sun Oct 16, 2011 7:24 am

I have added nat rule for wan1 , wan 2 and wan 3 and now I can acess the modems but will this effect the load balancing (Is this OK?)

Who is online

Users browsing this forum: No registered users and 168 guests