Page 1 of 1

combine two lines is not working

Posted: Wed Oct 27, 2010 12:54 pm
by namo
I have Mikrotik v4.11 with hotspot. I try to combine two ADSL line using the code below but the internet is not working properly. the windows live messenger is working and Google main page only working. the internet was working fine before I used the fallowing code:
/ip address
add address=192.168.4.60/24 disabled=no interface=outside1
add address=192.168.7.60/24 disabled=no interface=outside2
add address=192.168.2.1/24 disabled=no interface=hotspot

/ip firewall address-list
add address=192.168.2.0/24 disabled=no list=Local_NAT_Networks

/ip firewall mangle
add action=mark-connection chain=input connection-state=new disabled=no in-interface=outside1 new-connection-mark=outside1_connection passthrough=yes
add action=mark-connection chain=input connection-state=new disabled=no in-interface=outside2 new-connection-mark=outside2_connection passthrough=yes
add action=mark-routing chain=output connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes
add action=mark-routing chain=output connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes
add action=accept chain=prerouting disabled=no dst-address=192.168.4.0/24 src-address-list=Local_NAT_Networks
add action=accept chain=prerouting disabled=no dst-address=192.168.7.0/24 src-address-list=Local_NAT_Networks
add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside1_connection passthrough=yes per-connection-classifier=src-address:2/0 src-address-list=Local_NAT_Networks
add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside2_connection passthrough=yes per-connection-classifier=src-address:2/1 src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes src-address-list=Local_NAT_Networks

/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.4.4 routing-mark=to_outside1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.7.7 routing-mark=to_outside2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=5 dst-address=0.0.0.0/0 gateway=192.168.4.4 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=10 dst-address=0.0.0.0/0 gateway=192.168.7.7 scope=30 target-scope=10

Re: combine two lines is not working

Posted: Wed Oct 27, 2010 4:44 pm
by namo
the problem occur after /ip route lines

192.168.4.4 and 192.168.7.7 are reachable. 192.168.4.4 marked AS but 192.168.7.7 marked S. if poth routes are enable, then the internet doesn't work. If only 192.168.4.4, then the internet is working but if only 192.168.7.7 enabled, then the internet is disabled.

I connect directly to 192.168.7.7 and the internet is working on this line

Note:
the route 192.168.7.7 which distance is 10 is marked S when both routes are enabled. why there is two routes for each ip: one with distance 1 and the other with distance 5 or 10

Re: combine two lines is not working

Posted: Wed Oct 27, 2010 5:08 pm
by Ibersystems

Re: combine two lines is not working

Posted: Thu Oct 28, 2010 6:35 am
by namo
but I want to combine the two lines not just use one and use the other when the first fail.

Both link has internet but the above code is not working in combining the two lines.

I have two options fix the code or return to one line and use this router before the Mikrotik:
http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... 0566424811

Re: combine two lines is not working

Posted: Thu Oct 28, 2010 10:34 am
by Ibersystems
Mmm...
If you modify the code... you can do it.. for example:

This:
/ip route
add distance=1 gateway=Host1 routing-mark=ISP1 check-gateway=ping
add distance=2 gateway=Host2 routing-mark=ISP1 check-gateway=ping
/ip route
add distance=1 gateway=Host2 routing-mark=ISP2 check-gateway=ping
add distance=2 gateway=Host1 routing-mark=ISP2 check-gateway=ping
With this:
/ip route
add distance=1 gateway=Host1 routing-mark=ISP1 check-gateway=ping
add distance=2 gateway=Host2 routing-mark=ISP1 check-gateway=ping
/ip route
add distance=2 gateway=Host2 routing-mark=ISP2 check-gateway=ping
add distance=1 gateway=Host1 routing-mark=ISP2 check-gateway=ping
With this change, the 2 routing marks will go through Host1, but if host1 have problems, the secondary one will work.

Re: combine two lines is not working

Posted: Thu Oct 28, 2010 5:20 pm
by Feklar
What are your NAT rules that you have set up to scr-nat out of the hotspot?

Re: combine two lines is not working

Posted: Thu Oct 28, 2010 6:02 pm
by namo
What are your NAT rules that you have set up to scr-nat out of the hotspot?

the firewall NAT has rule for hotspot
chain srcnat
Src Address 192.168.2.0/24
Action = masquerade

similar rule for PPPoE but Src Address 192.168.5.0/24

I have hotspot and PPPoE in the same interface and the internet is working when I have one WAN. when I add the second WAN the internet stop working

Re: combine two lines is not working

Posted: Thu Oct 28, 2010 6:04 pm
by fewi
Hotspots lead to the router sourcing all traffic due to automatic proxying, so all web traffic is in the output chain and never hits prerouting. PCC and Hotspots don't work well together out of the box.
To fix that for 99% of all traffic you can circumvent the Hotspot servlets:
/ip firewall nat
add chain=pre-hotspot action=accept dst-address-type=!local hotspot=auth
That has side effects. You can no longer insert ads, for example. I wouldn't recommend running that unless you really understand how the Hotspot works at a low level. Alternatively you can rewrite your PCC rule set to also balance traffic in the output chain, but probably just for HTTP traffic so that truly router generated management traffic isn't affected. Unless you really want to sit down and figure this out and experiment buying that other router might be a lot easier if it does what you need it to.

Re: combine two lines is not working

Posted: Fri Oct 29, 2010 6:28 am
by namo
Hotspots lead to the router sourcing all traffic due to automatic proxying, so all web traffic is in the output chain and never hits prerouting. PCC and Hotspots don't work well together out of the box.
To fix that for 99% of all traffic you can circumvent the Hotspot servlets:
/ip firewall nat
add chain=pre-hotspot action=accept dst-address-type=!local hotspot=auth
That has side effects. You can no longer insert ads, for example. I wouldn't recommend running that unless you really understand how the Hotspot works at a low level. Alternatively you can rewrite your PCC rule set to also balance traffic in the output chain, but probably just for HTTP traffic so that truly router generated management traffic isn't affected. Unless you really want to sit down and figure this out and experiment buying that other router might be a lot easier if it does what you need it to.
I think that I will try the router in ebay. I will create two PPPoE accounts on Mikrotik

Re: combine two lines is not working

Posted: Tue Jan 04, 2011 6:48 am
by salama900
dear Ibersystems

i see ur reply to a friend about fix the hotspot side effect on pcc load balance, bu really iam beginner in router ROS or can say that
i tired much to understand this rules meanings in the page http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting
but could not arrive ay result hope to kow about that
/ip route
add distance=1 gateway=Host1 routing-mark=ISP1 check-gateway=ping
add distance=2 gateway=Host2 routing-mark=ISP1 check-gateway=ping
add distance=1 gateway=Host2 routing-mark=ISP2 check-gateway=ping
add distance=2 gateway=Host1 routing-mark=ISP2 check-gateway=ping

hope u guide me to put it really i feel this will fix the side effects of pcc with hotspot from 2 isp

so i want to know the meaning of host 1 and 2 and when i put the rules the router gave suntax error wo i sent u this messag to ask about host 1 and to + isp1 and isp2 so know how to handel the rule
my 2 lines info is
first line is : 192.168.0.1/24 isp 1 with dns 163.12.128.134 + 135
second line is 192.168.1.1/24 with 5 static ip 196.212.9.25/29 not use it now

please give me rule can understand this rules so then i can work by it caz i need it to test it

hope u give me hand and help ne caz internet become slow many times per day

thanks fove giving hands to me
eyeon_light@yahoo.com
thanks