openvpn push route via interface
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I configured my openvpn server to use 172.31.48.0/20, where ips from 172.31.48.0 to 172.31.62.255 are statically assigned, and 172.31.63.0/24 are dynamic.
tls-server
mode server
push "topology subnet"
ifconfig 172.31.48.1 255.255.240.0
ifconfig-pool 172.31.63.0 172.31.63.254 255.255.255.0
Where the static hosts have their ip set via ifconfig-push 172.31.48.2 255.255.240.0
in a file that matches their common name, and is in the client-configs directory that the server specified.
Clients that do not have a file with a corresponding common name will get a dynamic ip in the range 172.31.63.0/24, but they will not get a route to 172.31.48.0/20, so I cannot ping from the vpn host (172.31.48.1) to a client with a dynamic ip (such as 172.31.63.1)
On the dynamic client, it only has a route for 172.31.63.0/24, as is specified by ifconfig-pool
. I would like to route all 172.31.48.0/20 traffic via the tun device that is created by the vpn client. If I run this command manually everything works:
sudo route add -net 172.31.48.0/20 dev vpn1
Where vpn1
is the vpn device specified in the client ovpn file
dev vpn1
dev-type tun
The route
option in openvpn wants an ip and not a device interface, though. Meaning, this will not work:
push "route 172.31.48.0 255.255.240.0 vpn1"
And if I leave off vpn1
then openvpn on the client side will complain that no gateway was specified.
How can I route the 172.31.48.0/20 subnet on clients that get a dynamic ip?
routing openvpn
add a comment |Â
up vote
0
down vote
favorite
I configured my openvpn server to use 172.31.48.0/20, where ips from 172.31.48.0 to 172.31.62.255 are statically assigned, and 172.31.63.0/24 are dynamic.
tls-server
mode server
push "topology subnet"
ifconfig 172.31.48.1 255.255.240.0
ifconfig-pool 172.31.63.0 172.31.63.254 255.255.255.0
Where the static hosts have their ip set via ifconfig-push 172.31.48.2 255.255.240.0
in a file that matches their common name, and is in the client-configs directory that the server specified.
Clients that do not have a file with a corresponding common name will get a dynamic ip in the range 172.31.63.0/24, but they will not get a route to 172.31.48.0/20, so I cannot ping from the vpn host (172.31.48.1) to a client with a dynamic ip (such as 172.31.63.1)
On the dynamic client, it only has a route for 172.31.63.0/24, as is specified by ifconfig-pool
. I would like to route all 172.31.48.0/20 traffic via the tun device that is created by the vpn client. If I run this command manually everything works:
sudo route add -net 172.31.48.0/20 dev vpn1
Where vpn1
is the vpn device specified in the client ovpn file
dev vpn1
dev-type tun
The route
option in openvpn wants an ip and not a device interface, though. Meaning, this will not work:
push "route 172.31.48.0 255.255.240.0 vpn1"
And if I leave off vpn1
then openvpn on the client side will complain that no gateway was specified.
How can I route the 172.31.48.0/20 subnet on clients that get a dynamic ip?
routing openvpn
My current workaround is to use a bogus ip as the gateway from the client. It gets routed appropriately on the server.push "route 172.31.48.0 255.255.240.0 172.31.63.254"
â jonr
Mar 22 at 23:25
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I configured my openvpn server to use 172.31.48.0/20, where ips from 172.31.48.0 to 172.31.62.255 are statically assigned, and 172.31.63.0/24 are dynamic.
tls-server
mode server
push "topology subnet"
ifconfig 172.31.48.1 255.255.240.0
ifconfig-pool 172.31.63.0 172.31.63.254 255.255.255.0
Where the static hosts have their ip set via ifconfig-push 172.31.48.2 255.255.240.0
in a file that matches their common name, and is in the client-configs directory that the server specified.
Clients that do not have a file with a corresponding common name will get a dynamic ip in the range 172.31.63.0/24, but they will not get a route to 172.31.48.0/20, so I cannot ping from the vpn host (172.31.48.1) to a client with a dynamic ip (such as 172.31.63.1)
On the dynamic client, it only has a route for 172.31.63.0/24, as is specified by ifconfig-pool
. I would like to route all 172.31.48.0/20 traffic via the tun device that is created by the vpn client. If I run this command manually everything works:
sudo route add -net 172.31.48.0/20 dev vpn1
Where vpn1
is the vpn device specified in the client ovpn file
dev vpn1
dev-type tun
The route
option in openvpn wants an ip and not a device interface, though. Meaning, this will not work:
push "route 172.31.48.0 255.255.240.0 vpn1"
And if I leave off vpn1
then openvpn on the client side will complain that no gateway was specified.
How can I route the 172.31.48.0/20 subnet on clients that get a dynamic ip?
routing openvpn
I configured my openvpn server to use 172.31.48.0/20, where ips from 172.31.48.0 to 172.31.62.255 are statically assigned, and 172.31.63.0/24 are dynamic.
tls-server
mode server
push "topology subnet"
ifconfig 172.31.48.1 255.255.240.0
ifconfig-pool 172.31.63.0 172.31.63.254 255.255.255.0
Where the static hosts have their ip set via ifconfig-push 172.31.48.2 255.255.240.0
in a file that matches their common name, and is in the client-configs directory that the server specified.
Clients that do not have a file with a corresponding common name will get a dynamic ip in the range 172.31.63.0/24, but they will not get a route to 172.31.48.0/20, so I cannot ping from the vpn host (172.31.48.1) to a client with a dynamic ip (such as 172.31.63.1)
On the dynamic client, it only has a route for 172.31.63.0/24, as is specified by ifconfig-pool
. I would like to route all 172.31.48.0/20 traffic via the tun device that is created by the vpn client. If I run this command manually everything works:
sudo route add -net 172.31.48.0/20 dev vpn1
Where vpn1
is the vpn device specified in the client ovpn file
dev vpn1
dev-type tun
The route
option in openvpn wants an ip and not a device interface, though. Meaning, this will not work:
push "route 172.31.48.0 255.255.240.0 vpn1"
And if I leave off vpn1
then openvpn on the client side will complain that no gateway was specified.
How can I route the 172.31.48.0/20 subnet on clients that get a dynamic ip?
routing openvpn
edited Mar 22 at 22:16
asked Mar 22 at 21:13
jonr
1011
1011
My current workaround is to use a bogus ip as the gateway from the client. It gets routed appropriately on the server.push "route 172.31.48.0 255.255.240.0 172.31.63.254"
â jonr
Mar 22 at 23:25
add a comment |Â
My current workaround is to use a bogus ip as the gateway from the client. It gets routed appropriately on the server.push "route 172.31.48.0 255.255.240.0 172.31.63.254"
â jonr
Mar 22 at 23:25
My current workaround is to use a bogus ip as the gateway from the client. It gets routed appropriately on the server.
push "route 172.31.48.0 255.255.240.0 172.31.63.254"
â jonr
Mar 22 at 23:25
My current workaround is to use a bogus ip as the gateway from the client. It gets routed appropriately on the server.
push "route 172.31.48.0 255.255.240.0 172.31.63.254"
â jonr
Mar 22 at 23:25
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f432935%2fopenvpn-push-route-via-interface%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
My current workaround is to use a bogus ip as the gateway from the client. It gets routed appropriately on the server.
push "route 172.31.48.0 255.255.240.0 172.31.63.254"
â jonr
Mar 22 at 23:25