[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] openvpn e redirect-gateway



Salve a tutti,

sto configurando una vpn con openvpn, con server e client linux. La
vpn funziona (mi collego e riesco a pingare l'interfaccia del server),
ma non riesco ad instradare
tutto il traffico attraveso la vpn. Vorrei cioè che tutto quello che
viene originato dal client, venisse instradato sulla vpn.
Dalla documentazione di openvpn leggo che:

  --redirect-gateway flags...
              (Experimental) Automatically execute routing commands to
cause all outgoing IP traffic to be redirected over the VPN.

              This option performs three steps:

              (1) Create a static route for the --remote address which
forwards to the pre-existing default gateway.  This is done so that
(3) will not create a routing loop.

              (2) Delete the default gateway route.

              (3) Set the new default gateway to be the VPN endpoint
address (derived either from --route-gateway or the second parameter
to --ifconfig when --dev tun is specified).

              When the tunnel is torn down, all of the above steps are
reversed so that the original default route is restored.

              Option flags:

              local -- Add the local flag if both OpenVPN servers are
directly connected via a common subnet, such as with wireless.  The
local flag will cause step 1 above to  be  omit-
              ted.

              def1  --  Use this flag to override the default gateway
by using 0.0.0.0/1 and 128.0.0.0/1 rather than 0.0.0.0/0.  This has
the benefit of overriding but not wiping out the
              original default gateway.


Questa è la mia configurazione server:

dev tap
secret /etc/openvpn/chiave.key
ping 15
verb 9
mute 10
ifconfig 10.0.5.1 255.255.255.252
lport 1199
push "redirect-gateway def1"
push "dhcp-option DNS 10.0.5.1"
persist-key

Quando mi collego, mi aspetterei sul client che ci fossero delle route
nuove, invece oltre a quella della rete 10.0.5.0 non cambia niente.

Grazie,

Luca.


Reply to: