Hi Jan,
2008/2/28 Jan Just Keijser <janjust@...>:
> Hi Luke,
>
> aaah I see... interesting setup...
>
> Two options:
> if you only have 2 clients then stop using the client/server model and
> set up two point-to-point connections. It's much easer to route all
> desired traffic over these 2 point-to-point links then when using the
> client/server model.
Oh I see. Would these point to point links be tun connecitons? I remember
playing with them, and I remember having to give the other party's IP to
both of them. This would require me to do port forwarding on client's router
which I don't want. Do you think I got what you meant? Is there a way to do
point-to-point connections w/o opening a port on client side?
I didn't understand what you meant in the following bullets:
>
>
> if you must use the client/server model then
> - add 'client-to-client'
> - make sure you can ping the VPN interface of client B from client A
> - add a route to the VPN server which does NOT use any kind of tunneling
do you mean add a route to A that routes to server?
>
> - add a route to client B which uses the VPN server
what woud this accomplish? what does "uses VPN server mean"
>
> - add a "default" route to point to client B directly.
In client A? route commands in client A do not accept B's IP as the gateway
as I said
>
> The " iroute " command probably won't help you here, as it would route
> all traffic from client B to the server first... the server will not
> grok this ...
with iroute I was able to make B advertise that it can route, and with route
on server towards B I was able to route server's traffic through B.
I should submit the final solution to the OpenVPN docs if we can figure this
out:)
>
>
> HTH,
>
> JJK
>
> Luke Bonasera wrote:
> > Client A <------> Server <-------> Client B
> >
> > Client A wants to use client B as gateway so that all of A's network
> > traffic except for the VPN connection will be routed through B. So A's
> > packets targeted to any IP on the internet except for the OpenVPN
> > server will first go to the server and then to B and then to the
> > internet from B. It's not much different than doing redirect-gateway
> > def1 on A, except that server is not the gateway but client B is.
> >
> > No, B is not supposed to connect to the OPenVPN server through client A.
> >
> > I hope it's more clear now.
> >
> >
> > On 28/02/2008, Jan Just Keijser <janjust@...> wrote:
> >
> >> Hi Luke,
> >>
> >> what are you trying to achieve here, exactly?
> >>
> >> server <---> client A <--> client B ?
> >>
> >> can you draw an ASCII art diagram of your desired network setup, coz I
> >> am completely confused by your last post ;-)
> >> Is client B supposed to connecto the openvpn server through client A?
> if
> >> so , why that would mean you've got double encryption.
> >>
> >> HTH,
> >>
> >> JJK
> >>
> >> Luke Bonasera wrote:
> >> >
> >> >
> >> > 2008/2/27 Jan Just Keijser <janjust@... <mailto:
> janjust@...>>:
> >>
> >>
> >> > Luke Bonasera wrote:
> >> > > On 26/02/2008, *Josh Cepek* <josh.cepek@...
> >> > <mailto:josh.cepek@...>
> >>
> >>
> >>> > <mailto:josh.cepek@... <mailto:josh.cepek@...>>> wrote:
> >>>
> >> > >
> >> > >
> >> > > You really don't want to do this (I'll explain why in a
> moment),
> >> > > but it
> >> > > is technically possible. To do this, you'd need to use
> tap
> >> > adapters
> >> > > (subnet topology may also work) since gateways need to be
> >> > reachable on
> >> > > the link level. You would then need to set the clients to
> >> > use the
> >> > > following OpenVPN directives or push them from the server:
> >> > "route
> >>
> >>
> >>> > remote_host 255.255.255.255 <http://255.255.255.255/>
> >>>
> >> > <http://255.255.255.255 <http://255.255.255.255/>> net_gateway"
> >> > > "route 0.0.0.0 <http://0.0.0.0/> <http://0.0.0.0
> >> > <http://0.0.0.0/>> 128.0.0.0 <http://128.0.0.0/> <
> http://128.0.0.0
> >>
> >>
> >>> <http://128.0.0.0/>>
> >>>
> >>> > <gateway_ip>" "route 128.0.0.0 <http://128.0.0.0/>
> >>>
> >> > <http://128.0.0.0 <http://128.0.0.0/>> 128.0.0.0 <
> http://128.0.0.0/>
> >> > > <http://128.0.0.0 <http://128.0.0.0/>> <gateway_ip>".
> Those
> >>
> >>
> >>> routes
> >>>
> >> > > will duplicate what "redirect-gateway def1" would have
> done
> >> > if it was
> >> > > redirecting to your chosen IP. You'll also need to either
> >> > explicitly
> >> > > set the gateway on any additional routes you're exposing
> or
> >> > use the
> >> > > route-gateway option. Finally, you can't send those
> options
> >> > to the
> >> > > machine acting as the gateway for all other clients since
> >> > that would
> >> > > create a routing loop.
> >> > >
> >> > >
> >> >
> >> > [...]
> >> >
> >> >
> >> > as for using a windows openvpn client as a gateway: sure it's
> >> > possible ,
> >> > even without routing&remote access on the client (which I'd
> >> > recommend) .
> >> >
> >> >
> >> >
> >> >
> >> > (sorry Jan, I sent a reply just to you. Here is an updated reply to
> >> > the group.)
> >> >
> >> >
> >> > Thanks for the info, but setting the client as gateway did not work.
> >> > Here is what I did:
> >> >
> >> > I have a OpenVPN server and two clients A and B. I wanted to make B
> a
> >> > gateway for A, so that A can route its traffic through B. This is
> what
> >> > I added to A's config file:
> >> >
> >>
> >>
> >>> route remote_host 255.255.255.255 <http://255.255.255.255> net_gateway
> >>>
> >> > route 0.0.0.0 <http://0.0.0.0> 128.0.0.0 <http://128.0.0.0> <VPN ip
> of B>
> >> > route 128.0.0.0 <http://128.0.0.0> 128.0.0.0 <http://128.0.0.0> <VPN
> >>
> >>
> >>> ip of B>
> >>>
> >> >
> >> > When A was trying to connect, here is what happened:
> >> >
> >> > Wed Feb 27 23:24:13 2008 Route: Waiting for TUN/TAP interface to
> come
> >> > up...
> >> > Wed Feb 27 23:24:15 2008 TEST ROUTES: 0/0 succeeded len=4 ret=0 a=0
> >> > u/d=down( x 5 as usual)
> >> >
> >> > Wed Feb 27 23:24:16 2008 TEST ROUTES: 2/4 succeeded len=4 ret=0 a=0
> u/d=up
> >> > Wed Feb 27 23:24:16 2008 Route: Waiting for TUN/TAP interface to
> come
> >> > up...
> >> > ( x 19 unusually...)
> >> >
> >> > Wed Feb 27 23:24:40 2008 route ADD <VPN server ip> MASK
> >>
> >>
> >>> 255.255.255.255 <http://255.255.255.255> <Default gateway of A>
> >>>
> >>> Wed Feb 27 23:24:40 2008 Route addition via IPAPI succeeded
> >>>
> >>> Wed Feb 27 23:24:40 2008 route ADD 0.0.0.0 <http://0.0.0.0> MASK
> >>>
> >> > 128.0.0.0 <http://128.0.0.0> <VPN ip of B>
> >>
> >>
> >>> Wed Feb 27 23:24:40 2008 Warning: route gateway is not reachable on
> >>>
> >> > any active network adapters: <VPN ip of B>
> >> > Wed Feb 27 23:24:40 2008 Route addition via IPAPI failed
> >>
> >>
> >>> Wed Feb 27 23:24:40 2008 route ADD 128.0.0.0 <http://128.0.0.0> MASK
> >>>
> >> > 128.0.0.0 <http://128.0.0.0> <VPN ip of B>
> >>
> >>
> >>> Wed Feb 27 23:24:40 2008 Warning: route gateway is not reachable on
> >>>
> >> > any active network adapters: <VPN ip of B>
> >> >
> >> > Where <VPN ip of B> is the IP that B normally gets for
> OpenVPN(thanks
> >> > to Jan and ifconfig-pool-persist), <VPN server ip> is the IP of my
> VPN
> >> > server and <Default gateway of A> is the default gateway of A.
> >> > and in the end:
> >> >
> >> > Wed Feb 27 23:46:43 2008 Initialization Sequence Completed With
> Errors
> >> > ( see http://openvpn.net/faq.html#dhcpclientserv )
> >> >
> >> > Besides, when there is no gateway route rule in the VPN, if I try to
> >> > add the route using "route add" in the windows command line, it
> won't
> >> > accept VPN IP addresses. The only such "route add" command that
> >> > windows accepts is when it is ran on a VPN client and the gateway is
> >> > given as the VPN server.
> >> > So, it seems like Josh's first suggestion does not work. If you
> really
> >> > think this is possible I'd appreciate alternative solutions. I would
> >> > prefer a solution in which multiple clients can act as gateways and
> >> > other clients can choose which gateway to use.
> >> >
> >> > Now I was able to route server's traffic through client by doing the
> >> > following:
> >> > In the server config:
> >> >
> >> > client-config-dir ccd
> >> > route <external ip of server's network that clients connect to>
> >>
> >>
> >>> 255.255.255.255 <http://255.255.255.255> net_gateway
> >>>
> >> > route 0.0.0.0 <http://0.0.0.0> 128.0.0.0 <http://128.0.0.0>
> >>
> >>
> >>> route 128.0.0.0 <http://128.0.0.0> 128.0.0.0 <http://128.0.0.0>
> >>>
> >> >
> >>
> >>
> >>> and in the ccd dir in the specific client file:
> >>>
> >> >
> >>
> >>
> >>> iroute 0.0.0.0 <http://0.0.0.0> 128.0.0.0 <http://128.0.0.0>
> >>>
> >> > iroute 128.0.0.0 <http://128.0.0.0> 128.0.0.0 <http://128.0.0.0>
> >>
> >>
> >> > Without the <external ip of server's network that clients connect
> to>
> >> > part, client couldn't connect to the server since server couldn't
> >> > route back to the client I guess. I found this out sort of by luck
> >> > while loking at the wireshark logs.
> >> >
> >> > This way, client and server managed to connect to each other and
> >> > server's traffic ran through the client. Now I didn't try to make
> >> > another client connect, but I'm assuming if I make other clients to
> >> > route to the server, it should then route to the gateway client. The
> >> > only big caveat right now is that I had to add the server's
> network's
> >> > external ip to the server configuration file. This is the router's
> >> > external IP that the clients connect to and it does port forwarding
> to
> >> > the OpenVPN server. If there is a way to get rid of this, I would
> love
> >> > to know. Also, any comments on this solution are welcome. It doesn't
> >> > look like multiple gateways will be able to coexist at the same time
> >> > in this setup, the server will have to choose which one is the
> active
> >> > one. If there is a way to make server agnostic to this in which
> >> > clients can use any other desired client as a gateway, it would be
> >> > even better. One solution that would probably work would be having a
> >> > parent VPN and having child VPNs that live inside of it that use the
> >> > route/iroute method, but would be a very bad design:) My point is,
> >> > since it is possible, I hope OpenVPN can also do it.
> >> >
> >> > Thanks in advance for the answers.
> >> >
> >> >
> >> > JJK
> >> >
> >> >
> >>
> >>
> >>
>
>
|