Internet Bandwidth

Kaushal Shriyan kaushalshriyan at gmail.com
Mon Dec 6 15:31:01 UTC 2010


On Sun, Dec 5, 2010 at 7:40 PM, Sambit Bikas Pal
<sambitbikaspal at gmail.com>wrote:

> On Sun, Dec 5, 2010 at 07:56, Kaushal Shriyan <kaushalshriyan at gmail.com>
> wrote:
> > Hi Sambit,
> > Thanks for the quick reply. So what i understand is to enable iptables on
> my
> > laptop or desktop to accomplish it.
> > Please help me understand with some examples. Would appreciate if you can
> > share me the iptables script.
>
> Hi Kaushal,
> It turns out slightly more complicated than I thought initially, but
> nevertheless can be done.
> You need two things- iptables and iproute2, both are there, by default
> in ubuntu. Follow the instructions given below.
>
> ###########################################
> #login as root
> sudo su
>
> #Create a new policy routing table for the non-default interface
> echo 1 WIFI >> /etc/iproute2/rt_tables
>
> #information about the non defualt interface
>
> ip route add 192.168.1.0/24 dev wlan0 src 192.168.1.10 table WIFI
> ip route add default via 192.168.1.1 dev wlan0 table WIFI
>
> #Remember to change 192.168.1.0/24 with the subnet of your wifi
> network, 192.168.1.10 with the address of your wlan0 interface
> #Replace wlan0 with the name of your wifi interface
> #Replace 192.168.1.1 with the gateway ip address
>
>
> #Add routing rule, replacing 192.168.1.10 with the ip address of your
> wifi interface
>
> ip rule add from 192.168.1.10/32 table WIFI
> ip rule add to 192.168.1.10/32 table WIFI
>
> #check the rules
>
> ip rule show
>
> #Now executing the iptable script to mark packets
>
> iptables -A PREROUTING -t mangle -i eth0 -p tcp --dport 6881:6999 -j
> MARK --set-mark 1
>
> #Bit torrent uses ports from 6881 to 6999, so iptables is marking
> packets destined for those ports.
>
> #Finally add a rule to send marked packets via the non defualt gateway
>
> ip rule add from all fwmark 1 table WIFI
>
> #######################################
>
> Let me know if there is any confusion.
>
> Hope it helps.
>
>
> --
> Sambit Bikas Pal
> Dept of Physics,
> Indian Institute Of Science Education & Research, Kolkata
>
>
Hi Sambit

Thanks for sharing the iptables script. I will definitely try it out and
update you with my findings.

Thanks again and much appreciated.

Thanks

Kaushal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20101206/81811b76/attachment.html>


More information about the ubuntu-users mailing list