Netgate m1n1wall

Author Topic: OpenVPN and dual WAN  (Read 5653 times)

0 Members and 1 Guest are viewing this topic.

Offline rcasas

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
OpenVPN and dual WAN
« on: September 18, 2006, 06:06:17 am »
Hi,

I have a dual wan installation of pfSense with an OpenVPN server running. The OpenVPN works only if clients connect through the default route of the pfSense box. OpenVPN is listenning on all interfaces by default, but the problem is that the OpenVPN server takes the default gateway of the machine, not the default gw of the interface.

I think this is a problem of the implementation of OpenVPN, but I want to know if anyone have an OpenVPN server working the way I want.

Greetings

Roberto

Offline hoba

  • Administrator
  • Hero Member
  • *****
  • Posts: 5837
  • What was the problem to this solution again?
    • View Profile
    • pfSense
Re: OpenVPN and dual WAN
« Reply #1 on: September 18, 2006, 06:23:26 am »
This problem is similiar what you encounter if you try to setup ipsec at an opt interface. Not sure if there is a way to work around that. This is still an unsolved issue atm, might turn out to be a limitation in 1.0 but that is not sure yet.

Offline rcasas

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: OpenVPN and dual WAN
« Reply #2 on: September 18, 2006, 06:39:00 am »
This problem is similiar what you encounter if you try to setup ipsec at an opt interface. Not sure if there is a way to work around that. This is still an unsolved issue atm, might turn out to be a limitation in 1.0 but that is not sure yet.

But IPsec have the option to choose which interface to use, and then it searches which is the gateway, am I right?

Offline Numbski

  • Full Member
  • ***
  • Posts: 276
  • FreeBSD/MacOS X nutcase
    • View Profile
Re: OpenVPN and dual WAN
« Reply #3 on: September 18, 2006, 07:40:07 am »
Okay, clear something up for me.

You're listening on all interfaces.  Then you have the issue that the connecting client uses its own default gateway, or the gateway of the pfSense box?

There are all kinds of push/pull statements available to pfSense clients and servers to force the client to conform to your will.  Have you looked at the example configs at the OpenVPN site?

Offline critter

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: OpenVPN and dual WAN
« Reply #4 on: September 18, 2006, 08:45:23 am »
Don't know if this is going to fix your issue, you can use option "float" to allow incoming packets from any IPs. From the openvpn man page:

--float
              Allow  remote  peer to change its IP address and/or port number,
              such as due to DHCP (this is the  default  if  --remote  is  not
              used).   --float  when specified with --remote allows an OpenVPN
              session to initially connect to a peer at a known address,  how-
              ever if packets arrive from a new address and pass all authenti-
              cation tests, the new address will take control of the  session.
              This  is  useful when you are connecting to a peer which holds a
              dynamic address such as a dial-in user or DHCP client.

              Essentially, --float tells OpenVPN to accept authenticated pack-
              ets  from  any address, not only the address which was specified
              in the --remote option.

Offline rcasas

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: OpenVPN and dual WAN
« Reply #5 on: September 19, 2006, 04:24:52 am »
Okay, clear something up for me.

You're listening on all interfaces.  Then you have the issue that the connecting client uses its own default gateway, or the gateway of the pfSense box?

There are all kinds of push/pull statements available to pfSense clients and servers to force the client to conform to your will.  Have you looked at the example configs at the OpenVPN site?

When I said 'default gateway', I wanted to say 'pfSense OPT1 default GW'

I have 2 WAN connections, the WAN connection has default gw GW1, and OPT1 has default gw GW2. When I connect any other service in the pfSense box, the service send packets over the GW from which he received incoming packets. In the case of OpenVPN, he takes the default gw from the system, so he always have GW1, and whenever he receives any packets (it doesn't matter if by WAN or OPT1), he replies by GW1.

Offline rcasas

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: OpenVPN and dual WAN
« Reply #6 on: September 19, 2006, 04:26:14 am »
Don't know if this is going to fix your issue, you can use option "float" to allow incoming packets from any IPs. From the openvpn man page:

I have tried, but it doesn't work yet. But I think it can be the solution.

Offline Numbski

  • Full Member
  • ***
  • Posts: 276
  • FreeBSD/MacOS X nutcase
    • View Profile
Re: OpenVPN and dual WAN
« Reply #7 on: September 19, 2006, 11:13:47 am »
I would suggest you look at the example configs on the OpenVPN website.  There are definitely route push statements that will fix this for you.

Offline critter

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: OpenVPN and dual WAN
« Reply #8 on: September 19, 2006, 07:30:45 pm »
Don't know if this is going to fix your issue, you can use option "float" to allow incoming packets from any IPs. From the openvpn man page:

I have tried, but it doesn't work yet. But I think it can be the solution.

Are you getting warning messages of packages from other IPs than expected? If so, I think "float" will fix it. Use it on the client box, the box with only one WAN.

Offline rcasas

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: OpenVPN and dual WAN
« Reply #9 on: September 21, 2006, 09:44:45 am »
I would suggest you look at the example configs on the OpenVPN website.  There are definitely route push statements that will fix this for you.

My problem is with the gateway of the server, not with the client.

Offline rcasas

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: OpenVPN and dual WAN
« Reply #10 on: September 21, 2006, 09:48:07 am »

Are you getting warning messages of packages from other IPs than expected? If so, I think "float" will fix it.

No, it simply don't connect

Quote
Use it on the client box, the box with only one WAN.

Yes, yes, I know.

Offline Numbski

  • Full Member
  • ***
  • Posts: 276
  • FreeBSD/MacOS X nutcase
    • View Profile
Re: OpenVPN and dual WAN
« Reply #11 on: September 21, 2006, 12:28:33 pm »
there are also route-up and route-down, plus just plain route statments that can be placed into your server config.  ;D

Please look more carefully at the examples.  You'll be amazed at how customized openvpn can get.