OpenVPN client binding to network interface












0















I am trying to bind an openvpn client's connection to an Ethernet port(eth1) in order to route an entire network through it.



I have already configured the OpenVPN server and tested it on a Windows client.



Server



The server is connected to the internet with interface "ens3" and "tun0" for the vpn. IP forwarding is enabled.



OpenVPN config



dev tun
ifconfig 10.8.0.1 10.8.0.2
secret /etc/openvpn/static.key
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
cipher AES-128-CBC


Client



The client will be running Raspbian Stretch Lite (Debian based). It has two Ethernet port eth0 and eth1. eth0 is connected to the internet with a static IP. I wish to route all of the openvpn traffic through eth1. A wireless router will plugged into eth1.



Client Config



remote XXX.XXX.XXX.XXX
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret /etc/openvpn/static.key
redirect-gateway def1 bypass-dhcp
dhcp-option DNS 1.1.1.1
dhcp-option DNS 1.0.0.1
cipher AES-128-CBC


How do I route the traffic to eth1?










share|improve this question

























  • Sorry, I don't understand what you're actually trying to achieve. You wish all traffic hitting the wireless router on a private network to be tunneled out through openvpn to the server over the interwebs?

    – tink
    Feb 24 at 16:59











  • Yeah I am trying to route traffic from that Wireless router to go through the the openvpn server. Server-INTERNET-Client(gateway/bridge)- Wireless router

    – Reseau DuPont
    Feb 24 at 17:12


















0















I am trying to bind an openvpn client's connection to an Ethernet port(eth1) in order to route an entire network through it.



I have already configured the OpenVPN server and tested it on a Windows client.



Server



The server is connected to the internet with interface "ens3" and "tun0" for the vpn. IP forwarding is enabled.



OpenVPN config



dev tun
ifconfig 10.8.0.1 10.8.0.2
secret /etc/openvpn/static.key
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
cipher AES-128-CBC


Client



The client will be running Raspbian Stretch Lite (Debian based). It has two Ethernet port eth0 and eth1. eth0 is connected to the internet with a static IP. I wish to route all of the openvpn traffic through eth1. A wireless router will plugged into eth1.



Client Config



remote XXX.XXX.XXX.XXX
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret /etc/openvpn/static.key
redirect-gateway def1 bypass-dhcp
dhcp-option DNS 1.1.1.1
dhcp-option DNS 1.0.0.1
cipher AES-128-CBC


How do I route the traffic to eth1?










share|improve this question

























  • Sorry, I don't understand what you're actually trying to achieve. You wish all traffic hitting the wireless router on a private network to be tunneled out through openvpn to the server over the interwebs?

    – tink
    Feb 24 at 16:59











  • Yeah I am trying to route traffic from that Wireless router to go through the the openvpn server. Server-INTERNET-Client(gateway/bridge)- Wireless router

    – Reseau DuPont
    Feb 24 at 17:12
















0












0








0








I am trying to bind an openvpn client's connection to an Ethernet port(eth1) in order to route an entire network through it.



I have already configured the OpenVPN server and tested it on a Windows client.



Server



The server is connected to the internet with interface "ens3" and "tun0" for the vpn. IP forwarding is enabled.



OpenVPN config



dev tun
ifconfig 10.8.0.1 10.8.0.2
secret /etc/openvpn/static.key
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
cipher AES-128-CBC


Client



The client will be running Raspbian Stretch Lite (Debian based). It has two Ethernet port eth0 and eth1. eth0 is connected to the internet with a static IP. I wish to route all of the openvpn traffic through eth1. A wireless router will plugged into eth1.



Client Config



remote XXX.XXX.XXX.XXX
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret /etc/openvpn/static.key
redirect-gateway def1 bypass-dhcp
dhcp-option DNS 1.1.1.1
dhcp-option DNS 1.0.0.1
cipher AES-128-CBC


How do I route the traffic to eth1?










share|improve this question
















I am trying to bind an openvpn client's connection to an Ethernet port(eth1) in order to route an entire network through it.



I have already configured the OpenVPN server and tested it on a Windows client.



Server



The server is connected to the internet with interface "ens3" and "tun0" for the vpn. IP forwarding is enabled.



OpenVPN config



dev tun
ifconfig 10.8.0.1 10.8.0.2
secret /etc/openvpn/static.key
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
cipher AES-128-CBC


Client



The client will be running Raspbian Stretch Lite (Debian based). It has two Ethernet port eth0 and eth1. eth0 is connected to the internet with a static IP. I wish to route all of the openvpn traffic through eth1. A wireless router will plugged into eth1.



Client Config



remote XXX.XXX.XXX.XXX
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret /etc/openvpn/static.key
redirect-gateway def1 bypass-dhcp
dhcp-option DNS 1.1.1.1
dhcp-option DNS 1.0.0.1
cipher AES-128-CBC


How do I route the traffic to eth1?







linux networking openvpn






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 24 at 16:29









Mr Shunz

3,45912128




3,45912128










asked Feb 24 at 16:11









Reseau DuPontReseau DuPont

1




1













  • Sorry, I don't understand what you're actually trying to achieve. You wish all traffic hitting the wireless router on a private network to be tunneled out through openvpn to the server over the interwebs?

    – tink
    Feb 24 at 16:59











  • Yeah I am trying to route traffic from that Wireless router to go through the the openvpn server. Server-INTERNET-Client(gateway/bridge)- Wireless router

    – Reseau DuPont
    Feb 24 at 17:12





















  • Sorry, I don't understand what you're actually trying to achieve. You wish all traffic hitting the wireless router on a private network to be tunneled out through openvpn to the server over the interwebs?

    – tink
    Feb 24 at 16:59











  • Yeah I am trying to route traffic from that Wireless router to go through the the openvpn server. Server-INTERNET-Client(gateway/bridge)- Wireless router

    – Reseau DuPont
    Feb 24 at 17:12



















Sorry, I don't understand what you're actually trying to achieve. You wish all traffic hitting the wireless router on a private network to be tunneled out through openvpn to the server over the interwebs?

– tink
Feb 24 at 16:59





Sorry, I don't understand what you're actually trying to achieve. You wish all traffic hitting the wireless router on a private network to be tunneled out through openvpn to the server over the interwebs?

– tink
Feb 24 at 16:59













Yeah I am trying to route traffic from that Wireless router to go through the the openvpn server. Server-INTERNET-Client(gateway/bridge)- Wireless router

– Reseau DuPont
Feb 24 at 17:12







Yeah I am trying to route traffic from that Wireless router to go through the the openvpn server. Server-INTERNET-Client(gateway/bridge)- Wireless router

– Reseau DuPont
Feb 24 at 17:12












0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502712%2fopenvpn-client-binding-to-network-interface%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502712%2fopenvpn-client-binding-to-network-interface%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?