Community discussions

MikroTik App
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

PPC+Hotspot on the same pc PLz help me Network diagram insid

Thu Mar 31, 2011 4:08 pm

I have 2 DSL line every one of them 2M... i need Hotspot & ppc in the same server(case) What i need and i need help from professional to do this without script i need to do every line on script by myself on GUI...and this network diagram
Image

Uploaded with ImageShack.us
 
armanalam
newbie
Posts: 47
Joined: Wed Nov 10, 2010 9:12 am

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Fri Apr 01, 2011 9:46 am

PCC and Hotspot isn't possible on the same machine.

Arman
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Fri Apr 01, 2011 4:31 pm

PCC and Hotspot isn't possible on the same machine.

Arman
PCC and hotspot possible on the same machine
 
rajeevsamal
just joined
Posts: 6
Joined: Sat Aug 14, 2010 11:48 am

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Fri Apr 01, 2011 6:23 pm

yes it is possible pcc load balancing and hotspot or pppoe on same machine

/ip address
add address=192.168.1.2/24 disabled=no interface=wlan1
add address=192.168.2.2/24 disabled=no interface=wlan2
add address=10.5.50.1/24 disabled=no interface=hotspot

/ip firewall mangle
add action=mark-connection chain=input in-interface=wlan1 new-connection-mark=wlan1_conn passthrough=yes comment=NET1
add action=mark-connection chain=output dst-port=80 new-connection-mark=wlan1_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0 protocol=tcp
add action=mark-connection chain=prerouting dst-address-type=!local dst-port=80 in-interface=wlan1 new-connection-mark=wlan1_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0 protocol=tcp
add action=mark-routing chain=prerouting connection-mark=wlan1_conn in-interface=wlan1 new-routing-mark=to_wlan1 passthrough=yes
add action=mark-routing chain=output connection-mark=wlan1_conn new-routing-mark=to_wlan1 passthrough=yes

add action=mark-connection chain=input in-interface=wlan2 new-connection-mark=wlan2_conn passthrough=yes comment=NET2
add action=mark-connection chain=output dst-port=80 new-connection-mark=wlan2_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1 protocol=tcp hotspot=auth
add action=mark-connection chain=prerouting dst-address-type=!local dst-port=80 in-interface=wlan2 new-connection-mark=wlan2_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1 protocol=tcp
add action=mark-routing chain=prerouting connection-mark=wlan2_conn in-interface=wlan2 new-routing-mark=to_wlan2 passthrough=yes
add action=mark-routing chain=output connection-mark=wlan2_conn new-routing-mark=to_wlan2 passthrough=yes

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

/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=wlan1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=wlan2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=30 target-scope=10


for wlan3 (another gateway) per-connaction-classfier=both-addresses-and-ports:3/0 for wlan1, 3/1 for wlan2, 3/2 for wlan3 other part is same
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Fri Apr 01, 2011 8:13 pm

PCC and Hotspot isn't possible on the same machine.

Arman
PCC and Hotspot are very possible on the same router. I have it running successfully at around 50 locations for well over a year.

Here is one example of a working setup.
http://forum.mikrotik.com/viewtopic.php ... 25#p175525

The problems you may run into is if you are doing proxy or transparent proxy on the same box along with the Hotspot and PCC, but even this is still possible. I successfully got that working in a lab environment.
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Fri Apr 01, 2011 10:27 pm

PCC and Hotspot isn't possible on the same machine.

Arman
PCC and Hotspot are very possible on the same router. I have it running successfully at around 50 locations for well over a year.

Here is one example of a working setup.
http://forum.mikrotik.com/viewtopic.php ... 25#p175525

The problems you may run into is if you are doing proxy or transparent proxy on the same box along with the Hotspot and PCC, but even this is still possible. I successfully got that working in a lab environment.
this configration insted of configration in wiki ppc or what??
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Fri Apr 01, 2011 10:55 pm

The main difference between that configuration and the one in the Wiki is that is specifies "hotspot=auth" on the PCC rules. That's what is doing most of the work in that case. You can also accomplish the same thing with a NAT rule.
/ip firewall nat
add action=accept chain=pre-hotspot hotspot=auth dst-address-type=!local
The reason why PCC does not work with the hotspot "out of the box" is because of the way the hotspot functions. Behind the scenes it redirects all traffic to itself, and this breaks the PCC configuration due to traffic now being on a different firewall chain than expected. The NAT rule above stops the hotspot from processing packets from authorized users, so things like PCC work normally. This rule however does break things like the advertising functions available from the MikroTik, and no load balancing will happen for people before they are authorized on the network.
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Fri Apr 01, 2011 11:29 pm

The main difference between that configuration and the one in the Wiki is that is specifies "hotspot=auth" on the PCC rules. That's what is doing most of the work in that case. You can also accomplish the same thing with a NAT rule.
/ip firewall nat
add action=accept chain=pre-hotspot hotspot=auth dst-address-type=!local
The reason why PCC does not work with the hotspot "out of the box" is because of the way the hotspot functions. Behind the scenes it redirects all traffic to itself, and this breaks the PCC configuration due to traffic now being on a different firewall chain than expected. The NAT rule above stops the hotspot from processing packets from authorized users, so things like PCC work normally. This rule however does break things like the advertising functions available from the MikroTik, and no load balancing will happen for people before they are authorized on the network.
when i create hotspot after create the rule or before? ...can i talk to u at your email?
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 12:07 am

You can create that firewall rule before or after, just the custom pre-hotspot chain will not exist until the hotspot has been created. By using the pre-hotspot firewall chain, you are basically applying a NAT rule before the hotspot does any processing on the packet.

The packet flow diagram shows you how packets are processed through the MikroTik. It is a very good document to have as it shows you how a packet flows through the router so you know where any why certain things work the way they do.
http://wiki.mikrotik.com/wiki/Packet_Flow#Diagram
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 4:31 am

You can create that firewall rule before or after, just the custom pre-hotspot chain will not exist until the hotspot has been created. By using the pre-hotspot firewall chain, you are basically applying a NAT rule before the hotspot does any processing on the packet.

The packet flow diagram shows you how packets are processed through the MikroTik. It is a very good document to have as it shows you how a packet flows through the router so you know where any why certain things work the way they do.
http://wiki.mikrotik.com/wiki/Packet_Flow#Diagram
I wrote this code but it fails only one line worked not both of them and i'm created hotspot after did script Where error??
/ip address
add address=192.168.2.2/24 disabled=no interface=WAN1
add address=192.168.1.200/24 disabled=no interface=WAN2
add address=10.0.0.2/24 disabled=no interface=hotspot

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

/ip firewall mangle
add action=mark-connection chain=input connection-state=new disabled=no in-interface=WAN1 new-connection-mark=WAN1_connection passthrough=yes
add action=mark-connection chain=input connection-state=new disabled=no in-interface=WAN2 new-connection-mark=WAN2_connection passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1_connection disabled=no new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2_connection disabled=no new-routing-mark=to_WAN2 passthrough=yes
add action=accept chain=prerouting disabled=no dst-address=192.168.2.0/24 src-address-list=Local_NAT_Networks
add action=accept chain=prerouting disabled=no dst-address=192.168.1.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=WAN1_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=WAN2_connection passthrough=yes per-connection-classifier=src-address:2/1 src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=WAN1_connection disabled=no new-routing-mark=to_WAN1 passthrough=yes src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=WAN2_connection disabled=no new-routing-mark=to_WAN2 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.2.1 routing-mark=to_WAN1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.254 routing-mark=to_WAN2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=5 dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=10 dst-address=0.0.0.0/0 gateway=192.168.1.254 scope=30 target-scope=10
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 5:42 am

What line specifically are you talking about not working? The mangle rules look right and they paste fine into one of my routers.

If you are talking about only one line being used, it's likely because of your PCC classifier. It it only taking it based off of the src-address, so this means that every connection coming from the same host will always get the same connection mark, and therefore always go out the same link. We use both-addresses for the classifier. It's random enough where both links will be used fairly evenly, but stable enough that it won't break forum web sites or banking web sites, as all connections from these same host to the same destination will always use the same link.

The classifier takes the paramiters you tell it to (src, dst address or both, src, dst port or both, or all of them together) and does a hash function on it and divides it by a given amount. Based on that value returned it gives it a different connection mark that you specify. Obviously the more variables you feed it, the more random it will be and the more evenly the connections will go up, but if it's too random you run the risk of breaking certain web sites like banking or forms.
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 5:56 am

What line specifically are you talking about not working? The mangle rules look right and they paste fine into one of my routers.

If you are talking about only one line being used, it's likely because of your PCC classifier. It it only taking it based off of the src-address, so this means that every connection coming from the same host will always get the same connection mark, and therefore always go out the same link. We use both-addresses for the classifier. It's random enough where both links will be used fairly evenly, but stable enough that it won't break forum web sites or banking web sites, as all connections from these same host to the same destination will always use the same link.

The classifier takes the paramiters you tell it to (src, dst address or both, src, dst port or both, or all of them together) and does a hash function on it and divides it by a given amount. Based on that value returned it gives it a different connection mark that you specify. Obviously the more variables you feed it, the more random it will be and the more evenly the connections will go up, but if it's too random you run the risk of breaking certain web sites like banking or forms.
What does that mean?? it's normal to use 2 line and in the end i download with speed of 1 line what advantage of ppc then
every line have 2m i need to download with speed 512k plz help me
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 9:17 am

The PCC setup was designed as and is a load balancing method, that's why you use it and that is its advantage. No one connection can exceed it's maximum throughput, but because it load balances you have a good chance of having your 2nd or 3rd or 4th connection go out of the line that is free. Because multiple connections will be balanced across multiple internet connections, you in effect have more bandwidth available to your network. You can also set it up to do failover to increase network up time and reliability. If you wanted to "combine" your connections and make them act as one, then you are looking at a bonding solution, not a load balancing one.

Bonding is rarely a viable option for most people to increase bandwidth. Usually to enact a bonding setup you need to own and control both ends of the bonded connection (in most situations this will be your local site and a remote site with a very high bandwidth connection). If both of your connections are from the same provider you can contact them and ask them if they support bonding, if they would be willing to set it up for you, and how much they would charge you for this, but this is not likely in most situations. I know of one device that claims to be able to dynamically bond TCP across multiple connections, but that hardware is very expensive.
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 3:46 pm

The PCC setup was designed as and is a load balancing method, that's why you use it and that is its advantage. No one connection can exceed it's maximum throughput, but because it load balances you have a good chance of having your 2nd or 3rd or 4th connection go out of the line that is free. Because multiple connections will be balanced across multiple internet connections, you in effect have more bandwidth available to your network. You can also set it up to do failover to increase network up time and reliability. If you wanted to "combine" your connections and make them act as one, then you are looking at a bonding solution, not a load balancing one.

Bonding is rarely a viable option for most people to increase bandwidth. Usually to enact a bonding setup you need to own and control both ends of the bonded connection (in most situations this will be your local site and a remote site with a very high bandwidth connection). If both of your connections are from the same provider you can contact them and ask them if they support bonding, if they would be willing to set it up for you, and how much they would charge you for this, but this is not likely in most situations. I know of one device that claims to be able to dynamically bond TCP across multiple connections, but that hardware is very expensive.
feklar but i see in the internet people work with ppc and download with speed of 2 line or 3 line why i can't do this i see some of people uploded images show success of this process i need from u to contact me at my mail and in the end we will publish the finshing here
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 4:45 pm

That is most likely because they are using a download manager that opens multiple sessions to download one file. In order to get the maximum effect in that case you'll want to use both addresses and ports as the PCC matcher and a 3rd party program.
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 4:48 pm

That is most likely because they are using a download manager that opens multiple sessions to download one file. In order to get the maximum effect in that case you'll want to use both addresses and ports as the PCC matcher and a 3rd party program.
i'm tried download with idm but the speed get from 1 line only
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sat Apr 02, 2011 5:29 pm

I have a suggestion ... You take the code and try it and tell me the result ok
 
ahmedprof
just joined
Topic Author
Posts: 10
Joined: Fri Mar 04, 2011 7:22 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Sun Apr 03, 2011 4:12 pm

Plz any body take my code to try and tell me the result and take Screen Capture of the download
 
alphahawk
Member Candidate
Member Candidate
Posts: 101
Joined: Fri Mar 28, 2008 6:40 pm

Re: PPC+Hotspot on the same pc PLz help me Network diagram i

Thu Apr 07, 2011 6:05 pm

Plz any body take my code to try and tell me the result and take Screen Capture of the download
Ahmedprof,

You are load balancing not bonding connections. Load balancing speeds are only as fast as the line it went out. What you are seeing is pictures from someone who is using a download manager to create multiple connections to the download. Doing that allows you to make a chance to make a connection across both trunks coming in. In that instance you CAN see the speed of both connections on 1 download.

The other time you might see this is if you are downloading 2 files at same time. If each download goes out a different trunk then you will get a full speed download of both files together equal to the speed of both trunks.

Regardless a rule to follow is that your max download will only be as fast as your fastest trunk using pcc load balancing.

Also might I make a suggestion and do a search on the forum for pcc hotspot. You will find multiple threads explaining how to fix it.

Who is online

Users browsing this forum: adwlodaro and 127 guests