Splitting international and local traffic on a Linksys WRT54G

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,169
toxichc:
Could you post the values that you've used in the startup script for the following variables: nic, auxl, intl & locl
Then, open a terminal connection to the router and run nvram get DD_BOARD and post its output (which is case sensitive) here.

If we have those values, then Gatecrasher can add exceptions for your router like he did for the Asus and Linksys WRT310N ones.
 

toxicehc

Well-Known Member
Joined
Aug 27, 2008
Messages
123
TP-Link TL-WR1043ND <- Output from vnram gert DD_BOARD

Script as I used it:

#!/bin/sh
PATH=/usr/sbin:/sbin:$PATH

#ISP usenames and passwords
intname=intaccount
intpass=intpassword
locname=localaccount
locpass=localpassword
auxname=myname@auxisp
auxpass=myauxpass

#IP Addresses
#saixsmtp=196.43.2.142
#saixnews=196.43.2.61
#isnews=196.26.208.123
#mypc=192.168.1.xxx
#mycam=192.168.1.xxx

#ddns info
#ddsyst=dyndns@dyndns.org
#dduser=myddnsname
#ddpass=myddnspass
#ddhost=myurl.com,hash
#ddchip=checkip.dyndns.org:80
#ddpage=/

#Timeout echo interval (secs)
tmo=60

#TP-Link
nic=nic-vlan2
auxl=1
intl=1
locl=3

echo "#!/bin/sh
while sleep 1; do
while [ \"\`ip link show dev ppp\$1\`\" != \"\" ]; do
gpio disable \$2
sleep 15
done
echo 1 > /tmp/fw.nok
while [ -f /tmp/fw.nok ]; do
gpio enable \$2; sleep 1
gpio disable \$2; sleep 1
done
/tmp/build.ppp\$1
done"> /tmp/checklink
chmod +x /tmp/checklink

conn () {

echo "#!/bin/sh
echo \"Running build.ppp$1\">> /tmp/build.log" >> /tmp/build.ppp$1
case $2 in
loc)
led=$locl
wget "http://developers.locality.co.za/routes.txt" -O /tmp/routes.txt
sleep 2
echo "for IP in \`cat /tmp/routes.txt\`; do
if [ \"\`echo \$IP|grep '{print \$1}'\`\" != \"#\" ]; then
gpio disable $led
route add -net \$IP ppp$1
gpio enable $led
fi
done">> /tmp/build.ppp$1
echo "route del default dev ppp$1">> /tmp/build.wall
;;
aux)
led=$auxl
echo "route del default dev ppp$1">> /tmp/build.wall
;;
int)
led=$intl
echo "route add default dev ppp$1">> /tmp/build.wall
;;
esac
if [ "$3" != "" ]; then
echo "route add -net $3 ppp$1; route add -host $3 ppp$1">> /tmp/build.ppp$1
if [ "$4" != "" ]; then
echo "route add -net $4 ppp$1; route add -host $4 ppp$1">> /tmp/build.ppp$1
if [ "$5" != "" ]; then
echo "route add -net $5 ppp$1; route add -host $5 ppp$1">> /tmp/build.ppp$1
if [ "$6" != "" ]; then
echo "route add -net $6 ppp$1; route add -host $6 ppp$1">> /tmp/build.ppp$1
fi
fi
fi
fi
echo "addr=\`ip addr show dev ppp$1|grep inet|awk '{print \$2}'\`
ip route flush table 10$1
peer=\`ip addr show dev ppp$1|grep inet|awk '{print \$4}'|awk -F '/' '{print \$1}'\`
ip route add default dev ppp$1 table 10$1
ip route add \$peer dev ppp$1 src \$addr table 10$1
ip rule del priority 10$1
ip rule add fwmark 0x10$1 table 10$1 priority 10$1
rout=\`ip route show dev br0|grep -m 1 'src'|awk '{print \$1}'\`
srce=\`ip route show dev br0|grep -m 1 'src'|awk '{print \$7}'\`
ip route add \$rout dev br0 src \$srce table 10$1
rout=\`ip route show dev lo|grep 'scope link'|awk '{print \$1}'\`
ip route add \$rout dev lo table 10$1">> /tmp/build.ppp$1
echo "echo 0 > /proc/sys/net/ipv4/conf/ppp$1/rp_filter
addr=\`ip addr show dev ppp$1|grep inet|awk '{print \$2}'\`
iptables -t mangle -A PREROUTING -i ppp$1 -j MARK --set-mark 0x10$1
iptables -t nat -A PREROUTING -d \$addr -j TRIGGER --trigger-type dnat">> /tmp/build.wall
ppn=$1
}

ddns () {
mkdir /tmp/ddns$ppn
echo "inadyn --background --dyndns_system $1 -u $2 -p $3 -a $4 --wildcard --ip_server_name $5 $6 --update_period_sec 360 --forced_update_period 2419200 --log_file /tmp/ddns$ppn/ddns.log --cache_dir /tmp/ddns$ppn --exec ddns_success">> /tmp/build.ppp$ppn
}

sdns () {
echo "nvram set wan_dns=\"\$(nvram get wan_get_dns)\"">> /tmp/build.ppp$ppn
}

drop () {
echo "iptables -I FORWARD -p $1 -m $1 -i ppp$ppn --dport $2 -j DROP
iptables -I INPUT -p $1 -m $1 -i ppp$ppn --dport $2 -j DROP
iptables -I OUTPUT -p $1 -m $1 -o ppp$ppn --sport $2 -j DROP">> /tmp/build.wall
}

news () {
echo "iptables -t mangle -I PREROUTING -p tcp -m tcp -s $3 --dport $2 -j MARK --set-mark 0x10$ppn
iptables -t nat -I PREROUTING -p tcp -m tcp -d $1 --dport $2 -j DNAT --to-destination $1:119
iptables -t nat -I PREROUTING -p tcp -m tcp -i ppp$ppn --dport 119 -j DNAT --to-destination $3:$2">> /tmp/build.wall
}

serv () {
echo "iptables -t nat -I PREROUTING -p $1 -m $1 -d \$addr --dport $2 -j DNAT --to-destination $3
iptables -I FORWARD -p $1 -m $1 -d $3 --dport $2 -j logaccept
iptables -t mangle -I PREROUTING -p $1 -m $1 -s $3 --sport $2 -j MARK --set-mark 0x10$ppn
iptables -t mangle -I OUTPUT -p $1 -m $1 -s $3 --sport $2 -j MARK --set-mark 0x10$ppn">> /tmp/build.wall
}

link () {
gpio enable $led
chmod +x /tmp/build.ppp$ppn
chmod +x /tmp/build.wall
pppd plugin /usr/lib/rp-pppoe.so $nic noipdefault noauth nodefaultroute noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp nomppe nomppc usepeerdns user $1 password $2 default-asyncmap mtu 1492 mru 1492 persist lcp-echo-interval $tmo lcp-echo-failure 10 maxfail 0 holdoff 30 unit $ppn
echo 1 > /tmp/fw.nok
while [ -f /tmp/fw.nok ]; do
sleep 1
done
/tmp/build.ppp$ppn
gpio disable $led
/tmp/checklink $ppn $led &
}

while [ `ps|grep -c options.pppoe` -lt 2 ]; do
sleep 1
done
killall pppd
killall redial
killall checklink
while [ `ps|grep -c options.pppoe` -gt 1 ]; do
sleep 1
done

echo "#!/bin/sh
echo \"Running build.wall\">> /tmp/build.log"> /tmp/build.wall

#Configure Connections

conn 0 int $saixsmtp
#drop tcp 22484
#drop udp 22484
#drop tcp 119
link $intname $intpass

conn 1 loc
#ddns $ddsyst $dduser $ddpass $ddhost $ddchip $ddpage
#serv tcp 22484 $mypc
#serv udp 22484 $mypc
#sdns
link $locname $locpass

#conn 2 aux $saixnews
#link $auxname $auxpass

#conn 3 aux
#news $isnews 333 $mypc
#link $auxname $auxpass
 

Gatecrasher

Executive Member
Joined
Jan 11, 2005
Messages
6,278
@Toxicehc

Thanks for that.

Do you get acceptable light behaviour? Basically, you should get a light coming on solid when the first connection (intl) is made, followed by a flashing light for a minute or two while the local routes are loading, then going solid. If a connection goes down, the light linked to the account will slowly blink on and off until the connection is restored. If the lights are working for you, the question is whether it is using appropriate lights? In the default script for the Linksys WRT54G/L, for example, there are white and amber lights on the front panel logo which I used for int and aux connection, and I used the DMZ LED light for local.
 

toxicehc

Well-Known Member
Joined
Aug 27, 2008
Messages
123
I haven't actually checked to be honest.

I will have a squiz and get back to you...
 

toxicehc

Well-Known Member
Joined
Aug 27, 2008
Messages
123
Sorry just something else, I noticed last night with my XBOX 360 that even whilst I am signing into the UK based server and am able to play games with internationals fairly nicely, I do on occasion struggle connecting to some locals.

Also when I do downloads which I know come from local sites for a fact ( based on which cape took the 2GB knock the night before... :)) I have picked up that I start at about 3.3mbps for a few seconds and then drop off to just over or under 1mb. Is this Telkom showing me the finger or is there perhaps some other reason for this?
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,169
toxichc: that is most likely just Telkom that's shaping you.
Also remember that Internet Explorer and Firefox already starts to download the file even before you've selected the location to save the file at,
so you'll ALWAYS see a decline in the speed for the first few seconds if you've taken a while to select the destination to save it at.
I'd suggest that you test the stuff after midnight, when the shaping isn't so bad.

One thing that many people don't realise is that it doesn't necessarily mean that a site is local if its hostname ends with .co.za !
 

toxicehc

Well-Known Member
Joined
Aug 27, 2008
Messages
123
Thanks Padda.

I am agreeing with the shaping.

These downloads are from XBOX live, which is cached locally by Akamai servers hosted somewhere, I suspect IS, NEOTEL or one of the other datacentres around.

I know it's local, cause it's not chomping away at my international cap. I am basing the 3.3mbps starting rate on the display on the router, which I basically only really see on local traffic with the ISP's that I am using. The drop is also again what I see on the graphs on the router so I don't believe it is my browser....

So I am going to go for Telkom Shaping my local 30GB because they can... ;-P
 

toxicehc

Well-Known Member
Joined
Aug 27, 2008
Messages
123
Streaming?

Greetings Gents.

When I am using the script I am unable to stream from Tversity on my Laptop to my xbox which I put in the DMZ in the GUI of my router.

Is there an additional firewall command I need to pass to achieve this?
 

knoop

Well-Known Member
Joined
Aug 7, 2006
Messages
277
Anyone managed to get IPv6 connectivity while splitting traffic with gatecrashers script? I followed this guide http://www.dd-wrt.com/wiki/index.php/IPv6 and setup 6to4 with DD-WRT v24-sp1 (07/27/08) std. I managed to get it working without the script (single PPoE connection to ISP) and could ping IPv6 addresses, but no luck with the script.
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,169
knoop: why do you need IPv6? Most ISP's here don't even support it.
 

knoop

Well-Known Member
Joined
Aug 7, 2006
Messages
277
knoop: why do you need IPv6? Most ISP's here don't even support it.
I'm a software dev. We do lots of P2P type stuff. ISP does not have to support IPV6 natively in order to use 6to4.
 

Gatecrasher

Executive Member
Joined
Jan 11, 2005
Messages
6,278
What I know about IPv6 is dangerous. But I will read the link.

On another topic, is anyone using the script to split out gaming from their regular traffic? Or using the script to take advantage of 10Mb/s browsing/streaming while still using 4Mb/s uncapped for downloads? How is it going?
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,169
I've now modified the script slightly so that all the WAGE/FreeZone traffic is routed via my WebAfrica Local Only account (aux connection).
The one cool trick that I've done was to let the Twilight PvPGN server connection (war3.co.za:6112) go through the WebAfrica account too, which would allow you to host WAGE bot games ;)

All you need to do is to set the 3rd 'conn' parameter to 'wage' like I've done for the aux connection.

Here's my modified script:
Code:
#!/bin/sh
PATH=/usr/sbin:/sbin:$PATH

#ISP usenames and passwords
intname=myname@intisp
intpass=myintpass
locname=myname@locisp
locpass=mylocpass
auxname=myname@wadsl.local
auxpass=myWebAfricaPass

#IP Addresses
saixsmtp=196.43.2.142
saixnews=196.43.2.61
isnews=196.26.208.123
#mypc=192.168.1.xxx
#mycam=192.168.1.xxx

#ddns info
#ddsyst=dyndns@dyndns.org
#dduser=myddnsname
#ddpass=myddnspass
#ddhost=myurl.com,hash
#ddchip=checkip.dyndns.org:80
#ddpage=/

#Timeout echo interval (secs)
tmo=60

#Linksys WRT54G/GS/GL
nic=nic-vlan1
auxl=2
intl=3
locl=7

#Exceptions
case $(nvram get DD_BOARD) in
	"Asus WL-520GU/GC" )
		auxl=4; intl=0; locl=1
	;;
	"Linksys WRT310N" )
		auxl=1; intl=1; locl=3
		nic=nic-vlan1
	;;
esac

echo "#!/bin/sh
while sleep 1; do
while [ \"\`ip link show dev ppp\$1\`\" != \"\" ]; do
gpio disable \$2
sleep 15
done
echo 1 > /tmp/fw.nok
while [ -f /tmp/fw.nok ]; do
gpio enable \$2; sleep 1
gpio disable \$2; sleep 1
done
/tmp/build.ppp\$1
done"> /tmp/checklink
chmod +x /tmp/checklink

conn () {
	echo "#!/bin/sh
echo \"Running build.ppp$1\">> /tmp/build.log" >> /tmp/build.ppp$1
	case $2 in
	loc)
		led=$locl
		wget "http://developers.locality.co.za/routes.txt" -O /tmp/routes.txt
		sleep 2 
		echo "for IP in \`awk '{print \$1}' /tmp/routes.txt\`; do
		if [ \"\$IP\" != \"#\" ]; then
			gpio disable $led
			route add -net \$IP ppp$1
			gpio enable $led
		fi 
		done">> /tmp/build.ppp$1
		echo "route del default dev ppp$1">> /tmp/build.wall
		;;
	aux)
		led=$auxl 
		echo "route del default dev ppp$1">> /tmp/build.wall
		;;
	int)
		led=$intl
		echo "route add default dev ppp$1">> /tmp/build.wall
		;;
	esac

	if [ "$3" != "" ]; then
		if [ "$3" = "wage" ]; then
			wageroute $1
		else
			echo "route add -net $3 ppp$1; route add -host $3 ppp$1">> /tmp/build.ppp$1
		fi
		if [ "$4" != "" ]; then
			echo "route add -net $4 ppp$1; route add -host $4 ppp$1">> /tmp/build.ppp$1
			if [ "$5" != "" ]; then
				echo "route add -net $5 ppp$1; route add -host $5 ppp$1">> /tmp/build.ppp$1
				if [ "$6" != "" ]; then
					echo "route add -net $6 ppp$1; route add -host $6 ppp$1">> /tmp/build.ppp$1
				fi
			fi
		fi
	fi
	echo "addr=\`ip addr show dev ppp$1|grep inet|awk '{print \$2}'\`  
ip route flush table 10$1 
peer=\`ip addr show dev ppp$1|grep inet|awk '{print \$4}'|awk -F '/' '{print \$1}'\` 
ip route add default dev ppp$1 table 10$1
ip route add \$peer dev ppp$1 src \$addr table 10$1
ip rule del priority 10$1
ip rule add fwmark 0x10$1 table 10$1 priority 10$1
rout=\`ip route show dev br0|grep -m 1 'src'|awk '{print \$1}'\`
srce=\`ip route show dev br0|grep -m 1 'src'|awk '{print \$7}'\` 
ip route add \$rout dev br0 src \$srce table 10$1
rout=\`ip route show dev lo|grep 'scope link'|awk '{print \$1}'\`
ip route add \$rout dev lo table 10$1">> /tmp/build.ppp$1 
echo "echo 0 > /proc/sys/net/ipv4/conf/ppp$1/rp_filter
addr=\`ip addr show dev ppp$1|grep inet|awk '{print \$2}'\`
iptables -t mangle -A PREROUTING -i ppp$1 -j MARK --set-mark 0x10$1 
iptables -t nat -A PREROUTING -d \$addr -j TRIGGER --trigger-type dnat">> /tmp/build.wall
	if [ "$3" = "wage" ]; then
		wagefirewall $1
	fi
	ppn=$1
}

wageroute () {
	# Steam
	echo "route add -host 41.185.24.21 ppp$1">> /tmp/build.ppp$1
	echo "route add -host 41.185.60.43 ppp$1">> /tmp/build.ppp$1

	# WAGE
	echo "route add -net 41.185.50.0/27 ppp$1">> /tmp/build.ppp$1
	echo "route add -host 196.220.59.29 ppp$1">> /tmp/build.ppp$1
	echo "route add -net 196.220.59.30/31 ppp$1">> /tmp/build.ppp$1	
	echo "route add -host 196.220.59.32 ppp$1">> /tmp/build.ppp$1
}

wagefirewall () {
	# Twilight PvPGN Server
	echo "iptables -t mangle -A PREROUTING -p tcp -m tcp -d 196.38.180.96 --dport 6112 -j MARK --set-mark 0x10$1">> /tmp/build.wall
}

ddns () {
	mkdir /tmp/ddns$ppn
	echo "inadyn --background --dyndns_system $1 -u $2 -p $3 -a $4 --wildcard --ip_server_name $5 $6 --update_period_sec 360 --forced_update_period 2419200 --log_file /tmp/ddns$ppn/ddns.log --cache_dir /tmp/ddns$ppn --exec ddns_success">> /tmp/build.ppp$ppn
}

sdns () {
	echo "nvram set wan_dns=\"\$(nvram get wan_get_dns)\"">> /tmp/build.ppp$ppn
}

drop () {
	echo "iptables -I FORWARD -p $1 -m $1 -i ppp$ppn --dport $2 -j DROP
iptables -I INPUT -p $1 -m $1 -i ppp$ppn --dport $2 -j DROP
iptables -I OUTPUT -p $1 -m $1 -o ppp$ppn --sport $2 -j DROP">> /tmp/build.wall
}

news () {
	echo "iptables -t mangle -I PREROUTING -p tcp -m tcp -s $3 --dport $2 -j MARK --set-mark 0x10$ppn
iptables -t nat -I PREROUTING -p tcp -m tcp -d $1 --dport $2 -j DNAT --to-destination $1:119
iptables -t nat -I PREROUTING -p tcp -m tcp -i ppp$ppn --dport 119 -j DNAT --to-destination $3:$2">> /tmp/build.wall
}

serv () {
	echo "iptables -t nat -I PREROUTING -p $1 -m $1 -d \$addr --dport $2 -j DNAT --to-destination $3
iptables -I FORWARD -p $1 -m $1 -d $3 --dport $2 -j logaccept
iptables -t mangle -I PREROUTING -p $1 -m $1 -s $3 --sport $2 -j MARK --set-mark 0x10$ppn 
iptables -t mangle -I OUTPUT -p $1 -m $1 -s $3 --sport $2 -j MARK --set-mark 0x10$ppn">> /tmp/build.wall
}

link () {
	gpio enable $led
	chmod +x /tmp/build.ppp$ppn
	chmod +x /tmp/build.wall
	pppd plugin /usr/lib/rp-pppoe.so $nic noipdefault noauth nodefaultroute noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp nomppe nomppc usepeerdns user $1 password $2 default-asyncmap mtu 1492 mru 1492 persist lcp-echo-interval $tmo lcp-echo-failure 10 maxfail 0 holdoff 30 unit $ppn
	echo 1 > /tmp/fw.nok
	while [ -f /tmp/fw.nok ]; do
		sleep 1
	done
	/tmp/build.ppp$ppn
	gpio disable $led
	/tmp/checklink $ppn $led &
}

while [ `ps|grep -c options.pppoe` -lt 2 ]; do
	sleep 1
done 
killall pppd 
killall redial
killall checklink
while [ `ps|grep -c options.pppoe` -gt 1 ]; do
	sleep 1
done

echo "#!/bin/sh
echo \"Running build.wall\">> /tmp/build.log"> /tmp/build.wall

#Configure Connections

conn 0 int $saixsmtp
#drop tcp 22484
#drop udp 22484
#drop tcp 119
link $intname $intpass

#conn 1 loc 
#ddns $ddsyst $dduser $ddpass $ddhost $ddchip $ddpage 
#serv tcp 22484 $mypc
#serv udp 22484 $mypc
#sdns 
#link $locname $locpass 

conn 2 aux wage
link $auxname $auxpass 

#conn 3 aux
#news $isnews 333 $mypc 
#link $auxname $auxpass
Edit:
I've now gone and replaced:
Code:
		echo "for IP in \`cat /tmp/routes.txt\`; do
		if [ \"\`echo \$IP|grep '{print \$1}'\`\" != \"#\" ]; then
with:
Code:
		echo "for IP in \`awk '{print \$1}' /tmp/routes.txt\`; do
		if [ \" \$IP\" != \"#\" ]; then
This was because the for loop didn't go line by line.
 
Last edited:

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,169
Here's a shell script that you can use to route the Mweb traffic via a specific ppp interface. If the ppp interface isn't already established, the script will dial it.
Code:
#!/bin/sh
PATH=/usr/sbin:/sbin:$PATH

# Connection Info
aux2user=accname@ispname
aux2pass=accpass

# Timeout
tmo=60
nic=nic-vlan1

mwebroutes () {
	wget "http://developers.locality.co.za/routes-mweb.txt" -O /tmp/routes-mweb.txt
	sleep 2
	for IP in `awk '{ print $1 }' /tmp/routes-mweb.txt`; do
		if [ "$IP" != "#" ]; then
			route add -net $IP ppp$1
		fi
	done
}

pppoe () {
	ppn=$4
	if [ "`ip link show dev ppp$ppn`" = "" ]; then
		tmo=$3
		nic=$5
		pppd plugin /usr/lib/rp-pppoe.so $nic noipdefault noauth nodefaultroute noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp nomppe nomppc usepeerdns user $1 password $2 default-asyncmap mtu 1492 mru 1492 persistlcp-echo-interval $tmo lcp-echo-failure 10 maxfail 0 holdoff 30 unit $ppn
	else
		echo "ppp$ppn already established"
	fi
}

if [ "$1" != "" ]; then
	ppn=$1

	echo "Setting up connection for ppp$ppn"
	pppoe $aux2user $aux2pass $tmo $ppn $nic
	echo "Adding routes for Mweb to ppp$ppn"
	mwebroutes $ppn
else
	echo "Please specify ppp interface # as argument"
fi
 

Squonk

Member
Joined
Jul 3, 2008
Messages
22
Routing between uncapped and unshaped accounts

Hi, now that uncapped bandwidth is more readily available for us ordinary users, I do not need to split between local and international anymore. I do however need to route my P2P and news server traffic via an unshaped account. I have Axxess JustSurf uncapped which does not allow heavy downloading. What I would like is to route uTorrent and Grabit to use a second unshaped international account but all other traffic to go via the uncapped account. I have tried setting up con 0 & con 1 (int & loc) to use the same account logins with con 2 (aux0) using the unshaped account. What happens is that only ppp0 and ppp2 shows up with ifconfig.

Ii there a way to disable the local routing but still have two accounts? I have tried setting up servers with the serv command as below but it still routes through con0. I have also tried it with the Drop command as shown.

I am sure there's an easy way to achieve this. Can anybody help, please?

Code:
#Configure Connections

conn 0 int $saixsmtp 
#drop tcp 28905
#drop udp 28905
#drop tcp 119
link $intname $intpass

conn 1 loc 
#drop tcp 119
#drop tcp 28905
#drop udp 28905
#ddns $ddsyst $dduser $ddpass $ddhost $ddchip $ddpage 
link $locname $locpass 

conn 2 aux $axxessnews
serv tcp 28905 $mypc
serv udp 28905 $mypc
link $auxname $auxpass
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,169
Squonk:
Unfortunately you cannot route P2P (bittorrent in specific) traffic via a certain PPPoE interface, because the destination port differs on each client that you're connecting to.

You can use 1 connection for everything, and then another for just the news server.
For this kind of setup, you'll use something like the following (which will create only ppp0 and ppp2):
Code:
#Configure Connections
conn 0 int
link $intname $intpass

conn 2 aux $axxessnews
link $auxname $auxpass
The only way that you can route P2P traffic via a specific interface, would be to setup rules for all the other Internet services.
Like you'll specify the account that should be used for P2P traffic as the international (default route) connection, and then you'll add mangle rules for HTTP, HTTPS and other ports to make use of an auxilary account.

I used a mangle rule to route the Twilight traffic via an auxilary account:
iptables -t mangle -A PREROUTING -p tcp -m tcp -d 196.38.180.96 --dport 6112 -j MARK --set-mark 0x10$1
You'll want to remove the -d parameter and change the $1 to the PPP interface's number. Like to route port 443 (HTTPS) traffic via ppp2, you'll use:
Code:
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 443 -j MARK --set-mark 0x102
 

Squonk

Member
Joined
Jul 3, 2008
Messages
22
Thanks for the advice. I will experiment with the IPTABLES command and see if I can come up with a workable solution.
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,169
I got the script working on the Buffalo WZR-HP-G300NH, which came with a custom DD-WRT version: v24SP2-EU-US (08/19/10) std

The custom version is quite impressive, seeing that you can enable PPPoE Relaying, allowing you to dial PPPoE connections from the PC's too!

You just have to make a modification to the script due to the WAN interface's name that differs by default:

Code:
#Exceptions
case $(nvram get DD_BOARD) in
	"Asus WL-520GU/GC" )
		auxl=4; intl=0; locl=1
	;;
	"Linksys WRT310N" )
		auxl=1; intl=1; locl=3
		nic=nic-vlan1
	;;
	"WZR-HP-G300NH" )
		nic=nic-eth1
	;;
esac
I haven't tried it with my Linksys WRT54GL again, but you can use
Code:
nic=nic-$(nvram get wan_iface)
instead of having to make exceptions.

I also added a sleep before the wget command, because I think the router is simply too fast for the PPP0 link to be established successfully before it tries to download the routes.
 
Top