Results 1 to 3 of 3

Thread: OpenVPN server and client at the same time?

  1. #1
    Join Date
    Nov 2005
    Location
    Tumba, Sweden
    Beans
    139
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question OpenVPN server and client at the same time?

    Hello I was wondering if anyone with OpenVPN experience has tried this.

    I have an Ubuntu server that is currently running Ubuntu 8.10.

    I was thinking of making it a VPN server for my iPhone and also for my laptop whenever i'm outside and need to access internet over insecure wireless networks.

    Now that part should be easy I found several guides on how to configure OpenVPN server, as well as enabling clients on iPhone, and OSX.

    However, the things is that my server is currently a OpenVPN client also, I have a paid tunnel set up to bypass my ISP blocking incoming traffic on various ports.

    Is it possible to keep this setting but still enabling a VPN server?

    Essentially causing traffic from my external device to go in through my tunnel to the VPN server, and then out through the external VPN provider.

    Does it make sense?

    Kind regards.
    Brian Levinsen

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: OpenVPN server and client at the same time?

    Sure. Just set up each tunnel on a separate port address. I have a box running half-a-dozen or more tunnels in both directions. They all use unique port numbers in the 20000-60000 range.

    Whether you can route the traffic out to the Internet depends on whether you have a firewall enabled. One simple solution is to use rules like:

    Code:
    iptables -A INPUT   -j ACCEPT -i tun0
    iptables -A FORWARD -j ACCEPT -i tun0 
    iptables -A OUTPUT  -j ACCEPT -o tun0
    iptables -A INPUT   -j ACCEPT -i tun1
    iptables -A FORWARD -j ACCEPT -i tun1
    iptables -A OUTPUT  -j ACCEPT -o tun1
    All these rules come before the MASQUERADE rule for outbound traffic.
    Last edited by SeijiSensei; October 26th, 2010 at 10:09 PM.

  3. #3
    Join Date
    Nov 2005
    Location
    Tumba, Sweden
    Beans
    139
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: OpenVPN server and client at the same time?

    Thanks, I will give it a try.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •