port redirection through a VPN

view full story

http://serverfault.com – I would like redirect my tcp traffic to IRC throught a VPN. I mark the packets with iptables and create a new route for this packets: echo 1 > /proc/sys/net/ipv4/ip_forward echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter iptables -t mangle -A OUTPUT ! -d -p tcp --dport 6667 -j MARK --set-mark 0x42 ip route add table VPN default dev tun0 ip rule add fwmark 0x42 table VPN ip route add default via dev tun0 table VPN The VPN connection: # ifconfig tun0 tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet adr:10.5. (HowTos)