[LARTC] Route P2P on separate link

Artūras Šlajus x11@h2o.pieva.net
Mon, 31 May 2004 08:42:51 +0300


This is a multi-part message in MIME format.
--------------020809090809010402050109
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Mihai Vlad wrote:
> Hello,
> 
> Is there a way to route p2p traffic on a separate ISP connection, just as
> you would choose a separate connection for http traffic?
> 
> I tried all sorts of setups based on:
> http://www.braindump.dk/en/wiki/?wikipage=PolicyRouting but with no luck.
> 
> Please help :)
> 
> (ipp2p is up and running)
you should MARK your packets in PREROUTING -t mangle, then identify them 
in iproute2 with fwmark. It's simmilar to this:

table_syn=mytable
$IPT -t mangle -I PREROUTING -i $LAN \
-m multiport -p udp --dports $INET_LOWLAT_UDP_PORTS -j MARK \
--set-mark 1
$IPT -t nat -I POSTROUTING -s $LAN_NET -o $INET_LOWLAT -j MASQUERADE
ip rule del fwmark 1 lookup $table_syn &> /dev/null
ip rule add fwmark 1 lookup $table_syn
ip route del table $table_syn &> /dev/null
inet_lowlat_gw=192.168.22.22
ip route add default via $inet_lowlat_gw dev $INET_LOWLAT table \ $table_syn

--------------020809090809010402050109
Content-Type: text/x-vcard; charset=utf-8;
 name="x11.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="x11.vcf"

YmVnaW46dmNhcmQNCmZuO3F1b3RlZC1wcmludGFibGU6QXJ0PUM1PUFCcmFzID1DNT1BMGxh
anVzDQpuO3F1b3RlZC1wcmludGFibGU7cXVvdGVkLXByaW50YWJsZTo9QzU9QTBsYWp1cztB
cnQ9QzU9QUJyYXMNCmVtYWlsO2ludGVybmV0OngxMUBoMm8ucGlldmEubmV0DQp0ZWw7Y2Vs
bDorMzcwNjg5NTg3MzMNCngtbW96aWxsYS1odG1sOkZBTFNFDQp1cmw6aHR0cDovL2gyby5z
a3kubHQvDQp2ZXJzaW9uOjIuMQ0KZW5kOnZjYXJkDQoNCg==
--------------020809090809010402050109--