1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Openvpn Transmission

Discussion in 'Tomato Firmware' started by waeking, Dec 18, 2012.

  1. waeking

    waeking Networkin' Nut Member

    I have searched the forums and can't seem to locate a thread. I only want transmission traffic to go to the vpn.

    I have the following setup
    router 192.168.1.1
    ifconfig br0:0 192.168.1.2 up #Used for transmission gui "rpc-bind-address": "192.168.1.2",
    ifconfig br0:1 192.168.1.3 up #Used for transmission traffic "bind-address-ipv4": "192.168.1.3",
    tun11 openvpn client #Connects to a different ip every time, static not on option

    iptables -I FORWARD -s 192.168.1.3 -o tun11 -j ACCEPT
    iptables -I FORWARD -i tun11 -d 192.168.1.3 -J ACCEPT
    iptables -I INPUT -o tun11 -j REJECT
    iptables -t nat -I POSTROUTING -s 192.168.1.3 -J MASQUERADING

    but still can't seem to get it to work.... Any help would be greate
     
  2. rafwes

    rafwes Serious Server Member

    Set default route on 192.168.1.2 to 192.168.1.3. Masquerading has to be done by 192.168.1.2 not you.
     
  3. rafwes

    rafwes Serious Server Member

    Now I understand better what you mean. Try telling iptables which interface to use for outgoing traffic from .3
    Code:
    iptables -t nat -I POSTROUTING -o tun11 -s 192.168.1.3 -J MASQUERADING
     
  4. waeking

    waeking Networkin' Nut Member

    I dont understand why because 192.168.1.1 192.168.1.2 and 192.168.1.3 all belong to the router. 192.168.1.1 is the gui for the router. 192.168.1.2 is the gui for transmission. and 192.168.1.3 is the address that transmission uses to listen on (used for QOS).

    Is there a way that I can set the default route for 192.168.1.3 to tun11? Is that what I need to do?
     
  5. rafwes

    rafwes Serious Server Member

    Pls discard that answer, see the new one :)
     
  6. waeking

    waeking Networkin' Nut Member

    So that doesn't seem to work.... and also we were both wrong for future reference it should be
    Code:
    iptables -t nat -I POSTROUTING -o tun11 -s 192.168.1.3 -J MASQUERADE
    There may be a routing problem.....

    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    208.85.40.92 10.10.0.6 255.255.255.255 UGH 0 0 0 tun12
    208.85.40.93 10.10.0.6 255.255.255.255 UGH 0 0 0 tun12
    208.53.158.146 64-201-214-1.re 255.255.255.255 UGH 0 0 0 vlan2
    208.85.40.20 10.10.0.6 255.255.255.255 UGH 0 0 0 tun12
    hidden * 255.255.255.255 UH 0 0 0 vlan2
    10.185.107.5 * 255.255.255.255 UH 0 0 0 tun11
    208.85.40.35 10.10.0.6 255.255.255.255 UGH 0 0 0 tun12
    208.85.40.80 10.10.0.6 255.255.255.255 UGH 0 0 0 tun12
    208.85.40.50 10.10.0.6 255.255.255.255 UGH 0 0 0 tun12
    10.185.107.1 10.185.107.5 255.255.255.255 UGH 0 0 0 tun11
    10.10.0.6 * 255.255.255.255 UH 0 0 0 tun12
    192.168.3.0 10.10.0.6 255.255.255.0 UG 512 0 0 tun12
    192.168.2.0 10.10.0.6 255.255.255.0 UG 512 0 0 tun12
    173.19.1.0 * 255.255.255.0 U 0 0 0 br1
    10.10.0.0 10.10.0.6 255.255.255.0 UG 0 0 0 tun12
    192.168.1.0 * 255.255.255.0 U 0 0 0 br0
    hidden * 255.255.254.0 U 0 0 0 vlan2
    127.0.0.0 * 255.0.0.0 U 0 0 0 lo
    default 10.185.107.5 128.0.0.0 UG 0 0 0 tun11
    128.0.0.0 10.185.107.5 128.0.0.0 UG 0 0 0 tun11
    default hidden 0.0.0.0 UG 0 0 0 vlan2

    I can
    Code:
    route del -net 0.0.0.0 netmask 128.0.0.0
    to get rid of the second default.
     

Share This Page