[HELP] PPTP Client PCC LoadBalancing

Hello friends

I try to Balance two PPTP clients that provide each 10Mbs .
WAN is same , with the same gateway .

My router connected to the internet with this configuration :

[admin@MikroTik] /ip address> print
 #   ADDRESS            NETWORK         INTERFACE                                                                   
 0   192.168.0.10/24  192.168.0.0   ether1  (WAN Network)
 1   10.10.10.1/24      10.10.10.0         ether2  (LAN Network)
 
 [admin@MikroTik] /ip route> print
 #      DST-ADDRESS        GATEWAY            DISTANCE
 0 A S  0.0.0.0/0                  192.168.0.1             1

I try to editing the PCC Example at : http://wiki.mikrotik.com/wiki/Manual:PCC , but don’t work .
Anyone can replace the PCC Example with the PPTP Clients ?

PCC Example :

/ ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=LAN
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=ISP1
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=ISP2

/ ip firewall mangle
add chain=prerouting dst-address=10.111.0.0/24  action=accept in-interface=LAN
add chain=prerouting dst-address=10.112.0.0/24  action=accept in-interface=LAN
add chain=prerouting in-interface=ISP1 connection-mark=no-mark action=mark-connection \
    new-connection-mark=ISP1_conn
add chain=prerouting in-interface=ISP2 connection-mark=no-mark action=mark-connection \ 
    new-connection-mark=ISP2_conn
add chain=prerouting  in-interface=LAN connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=ISP1_conn 
add chain=prerouting  in-interface=LAN connection-mark=no-mark dst-address-type=!local \ 
    per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=ISP2_conn
add chain=prerouting connection-mark=ISP1_conn in-interface=LAN action=mark-routing \ 
    new-routing-mark=to_ISP1
add chain=prerouting connection-mark=ISP2_conn in-interface=LAN action=mark-routing \
    new-routing-mark=to_ISP2
add chain=output connection-mark=ISP1_conn action=mark-routing new-routing-mark=to_ISP1     
add chain=output connection-mark=ISP2_conn action=mark-routing new-routing-mark=to_ISP2

/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 routing-mark=to_ISP1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.112.0.1 routing-mark=to_ISP2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.111.0.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.112.0.1 distance=2 check-gateway=ping

/ ip firewall nat 
add chain=srcnat out-interface=ISP1 action=masquerade
add chain=srcnat out-interface=ISP2 action=masquerade

EDIT :

What I Have : My WAN have 50Mbps internet speed .

What I Want : I want to make two connection to a PPTP Server .

Why ? : because That PPTP server just provide 10Mbps per client .

for : to have a 20 Mbps connection to that PPTP server .

P.S : I don’t access to that PPTP-Server and I’m connecting to that server as customer .

What is it that you want to achieve?

Normaly, you would use Load Balance to manage traffic between 2 or more WAN links.
If you have only one WAN, what is it you want to balance? You want traffic that somehow comes from the internet (your WAN link) to your RB to be balanced between 2 servers (servers been your PPTP clients)? I can’t think of another scenario.

But, if you want is your PPTP clientes to be able to access internet, just add a rule on your nat table, like this:

/ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade

Also, there seems to be something wrong with your WAN address

 0   192.168.0.10/24  192.169.169.0   ether1  (WAN Network)

You must have tryed to edit the text after you coped from ros terminal. that network 192.169.169.0 can’t be there since you specified 192.168.0.10/24 as address. The network value should be 192.168.0.0

Thanks inquiery , I’ve edited the ROS from first post that an example of my network .

What I Have : My WAN have 50Mbps internet speed .

What I Want : I want to make two connection to a PPTP Server .

Why ? : because That PPTP server just provide 10Mbps per client .

for : to have a 20 Mbps connection to that PPTP server .

P.S : I don’t access to that PPTP-Server and I’m connecting to that server as customer .

:smiley:

Well, than you have two PPTP Cliente interfaces, let’s call them “pptp-out1” and “pptp-out2”.

Lets ignore the first lines for assigning IPs for your LAN and WAN, since you have that already set up.

So, you’ll have to addapt some rules from that example, like:

These first 2 rules for you are not necessary, since they are meant to accept traffic to devices in the same network as your WANs in the load balance are. But you are using PPTP links, and that means no other device are in that network. So, just ignore those 2 rules in the PPC example in the wiki.

#add chain=prerouting dst-address=10.111.0.0/24  action=accept in-interface=LAN
#add chain=prerouting dst-address=10.112.0.0/24  action=accept in-interface=LAN

Those 2 rules are meant for traffic comming from outside your ROS, so they have connection marks assigned to them, what will make following rules not to apply, since they verify if there is any connection mark already applyed.

/ip firewall mangle
add chain=prerouting in-interface=pptp-out1 connection-mark=no-mark action=mark-connection \
    new-connection-mark=pptp-out1_conn
add chain=prerouting in-interface=pptp-out2 connection-mark=no-mark action=mark-connection \ 
    new-connection-mark=pptp-out2_conn

These 2 lines are the ones that will acctually make our load balance. They will mark traffic going out of your network to be afterwards routed to specific routing tables. Those same routing tables will be used in the 2 rules above, but since the traffic there is comming from outside, the connection must respect that route in response.

add chain=prerouting  in-interface=ether2 connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=pptp-out1_conn 
add chain=prerouting  in-interface=ether2 connection-mark=no-mark dst-address-type=!local \ 
    per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=pptp-out2_conn

Here is where you mark the connection with a specific routing-mark. Those routing marks you’ll use to specify routing tables specific for them. Note that “in-interface=ether2”, this means that this traffic is comming from outside to be routed to a cliente behind your ROS router that IS NOT the router itself.

add chain=prerouting connection-mark=pptp-out1_conn in-interface=ether2 action=mark-routing \ 
    new-routing-mark=to_pptp-out1
add chain=prerouting connection-mark=pptp-out2_conn in-interface=ether2 action=mark-routing \
    new-routing-mark=to_pptp-out2

Those 2 final mangle rules are meant from traffic that will leave ROS but are ROS traffic, not clients. When PPTP connection comes from outside with your ROS as destination, ROS will respond to them in the output chain, so you ned to mark the routes here, since the connection-mark have already been set from rules above (the first 2 ones).

add chain=output connection-mark=pptp-out1_conn action=mark-routing new-routing-mark=to_pptp-out1
add chain=output connection-mark=pptp-out2_conn action=mark-routing new-routing-mark=to_pptp-out2

That’s it for mangle.
Now, you need to create your routing tables for each of your 2 routing marks.

/ip route
add dst-address=0.0.0.0/0 gateway=pptp-out1 routing-mark=to_pptp-out1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pptp-out2 routing-mark=to_pptp-out2 check-gateway=ping

And default routes for main ROS routing table.

add dst-address=0.0.0.0/0 gateway=pptp-out1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pptp-out2 distance=2 check-gateway=ping

I have not testes it. I just addapted the rules from example for your scenario. I’m also kind of a begginer, and I’m only answering your question because no one else with experience did. You can test it your self, and if it works, it means that we both are learning :slight_smile:

The problem for you here, is that you are Load Balancing your traffic to 2 10mbps PPTP links, and your 50mb link will not be used. If it work, you will have to addapt your rules to include your 50mb link in the load balance. I don’t know how is it you want your WAN link to work with your PPTP links, so, if you need any further help addapting the rules after that, just post here and we can try to figure something out.