tun2socks (badvpn) - having trouble with setup
I am attempting to use tun2socks/badvpn to force all traffic through the tun device, but am having some issues. From wireshark, it appears that traffic is indeed going out properly, but not coming back in. By that, I mean that I can see an ACK from the target server, but it appears that that ACK isn't getting processed.
I also see in the badvpn command output that the reply is not successful, socks error. I am trying to run it again with a more verbose log level to see if it outputs anything useful.
- completely empty iptables ruleset, INPUT, OUTPUT, and FORWARD are all ACCEPT
- enabled ip forwarding for all interfaces and explicitly for the tun device as well as my workstation interfaces
- created tunnel device with ip 10.0.0.1
- setup tun2socks on 10.0.0.2 with a socks server of 127.0.0.1
- setup routes:
a. route add 127.0.0.1 gw <192.168.1.1> metric 50
b. route add default gw 10.0.0.2 metric 75
Any ideas as to what I may be missing here?
Thanks,
Walter
linux tunneling
add a comment |
I am attempting to use tun2socks/badvpn to force all traffic through the tun device, but am having some issues. From wireshark, it appears that traffic is indeed going out properly, but not coming back in. By that, I mean that I can see an ACK from the target server, but it appears that that ACK isn't getting processed.
I also see in the badvpn command output that the reply is not successful, socks error. I am trying to run it again with a more verbose log level to see if it outputs anything useful.
- completely empty iptables ruleset, INPUT, OUTPUT, and FORWARD are all ACCEPT
- enabled ip forwarding for all interfaces and explicitly for the tun device as well as my workstation interfaces
- created tunnel device with ip 10.0.0.1
- setup tun2socks on 10.0.0.2 with a socks server of 127.0.0.1
- setup routes:
a. route add 127.0.0.1 gw <192.168.1.1> metric 50
b. route add default gw 10.0.0.2 metric 75
Any ideas as to what I may be missing here?
Thanks,
Walter
linux tunneling
Would you mind posting a link about tun2vpn? cant find it in google.
– Rui F Ribeiro
Mar 21 '16 at 11:05
Oops, it is tun2socks (badvpn): github.com/ambrop72/badvpn
– Walter
Mar 21 '16 at 18:57
add a comment |
I am attempting to use tun2socks/badvpn to force all traffic through the tun device, but am having some issues. From wireshark, it appears that traffic is indeed going out properly, but not coming back in. By that, I mean that I can see an ACK from the target server, but it appears that that ACK isn't getting processed.
I also see in the badvpn command output that the reply is not successful, socks error. I am trying to run it again with a more verbose log level to see if it outputs anything useful.
- completely empty iptables ruleset, INPUT, OUTPUT, and FORWARD are all ACCEPT
- enabled ip forwarding for all interfaces and explicitly for the tun device as well as my workstation interfaces
- created tunnel device with ip 10.0.0.1
- setup tun2socks on 10.0.0.2 with a socks server of 127.0.0.1
- setup routes:
a. route add 127.0.0.1 gw <192.168.1.1> metric 50
b. route add default gw 10.0.0.2 metric 75
Any ideas as to what I may be missing here?
Thanks,
Walter
linux tunneling
I am attempting to use tun2socks/badvpn to force all traffic through the tun device, but am having some issues. From wireshark, it appears that traffic is indeed going out properly, but not coming back in. By that, I mean that I can see an ACK from the target server, but it appears that that ACK isn't getting processed.
I also see in the badvpn command output that the reply is not successful, socks error. I am trying to run it again with a more verbose log level to see if it outputs anything useful.
- completely empty iptables ruleset, INPUT, OUTPUT, and FORWARD are all ACCEPT
- enabled ip forwarding for all interfaces and explicitly for the tun device as well as my workstation interfaces
- created tunnel device with ip 10.0.0.1
- setup tun2socks on 10.0.0.2 with a socks server of 127.0.0.1
- setup routes:
a. route add 127.0.0.1 gw <192.168.1.1> metric 50
b. route add default gw 10.0.0.2 metric 75
Any ideas as to what I may be missing here?
Thanks,
Walter
linux tunneling
linux tunneling
edited Mar 21 '16 at 19:50
Rui F Ribeiro
39.5k1479132
39.5k1479132
asked Mar 21 '16 at 0:16
WalterWalter
5172618
5172618
Would you mind posting a link about tun2vpn? cant find it in google.
– Rui F Ribeiro
Mar 21 '16 at 11:05
Oops, it is tun2socks (badvpn): github.com/ambrop72/badvpn
– Walter
Mar 21 '16 at 18:57
add a comment |
Would you mind posting a link about tun2vpn? cant find it in google.
– Rui F Ribeiro
Mar 21 '16 at 11:05
Oops, it is tun2socks (badvpn): github.com/ambrop72/badvpn
– Walter
Mar 21 '16 at 18:57
Would you mind posting a link about tun2vpn? cant find it in google.
– Rui F Ribeiro
Mar 21 '16 at 11:05
Would you mind posting a link about tun2vpn? cant find it in google.
– Rui F Ribeiro
Mar 21 '16 at 11:05
Oops, it is tun2socks (badvpn): github.com/ambrop72/badvpn
– Walter
Mar 21 '16 at 18:57
Oops, it is tun2socks (badvpn): github.com/ambrop72/badvpn
– Walter
Mar 21 '16 at 18:57
add a comment |
1 Answer
1
active
oldest
votes
Here are the proper steps:
First check if your DNS is a remote one or a local one
cat /etc/resolv.conf
if it's a local one like192.168.1.1
it does not a matter but if the DNS is remote for example208.67.222.222
you need to add a route for it (see below)
Connect to your ssh server
ssh -N -C -D 8080 user@222.x.x.222
Add tun interface
ip tuntap add dev tun0 mode tun user <someuser>
Setup the tun interface
sudo ifconfig tun0 10.0.0.1 netmask 255.255.255.0
run tun2socks
badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:1080
if your DNS is a remote one add a route to it with a lower metric than the tun one (lower than metric on step 8)
route add 208.67.222.222 gw 192.168.1.1 metric 4
Add a route for your ssh server not 127.0.0.1
route add 222.x.x.222 gw 192.168.1.1 metric 4
Add a default route to forward everything to the tun
route add default gw 10.0.0.2 metric 6
Your mistake was 127.0.0.1
i guess your ssh server is remote not running on 127.0.0.1
...
add a comment |
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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f271167%2ftun2socks-badvpn-having-trouble-with-setup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here are the proper steps:
First check if your DNS is a remote one or a local one
cat /etc/resolv.conf
if it's a local one like192.168.1.1
it does not a matter but if the DNS is remote for example208.67.222.222
you need to add a route for it (see below)
Connect to your ssh server
ssh -N -C -D 8080 user@222.x.x.222
Add tun interface
ip tuntap add dev tun0 mode tun user <someuser>
Setup the tun interface
sudo ifconfig tun0 10.0.0.1 netmask 255.255.255.0
run tun2socks
badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:1080
if your DNS is a remote one add a route to it with a lower metric than the tun one (lower than metric on step 8)
route add 208.67.222.222 gw 192.168.1.1 metric 4
Add a route for your ssh server not 127.0.0.1
route add 222.x.x.222 gw 192.168.1.1 metric 4
Add a default route to forward everything to the tun
route add default gw 10.0.0.2 metric 6
Your mistake was 127.0.0.1
i guess your ssh server is remote not running on 127.0.0.1
...
add a comment |
Here are the proper steps:
First check if your DNS is a remote one or a local one
cat /etc/resolv.conf
if it's a local one like192.168.1.1
it does not a matter but if the DNS is remote for example208.67.222.222
you need to add a route for it (see below)
Connect to your ssh server
ssh -N -C -D 8080 user@222.x.x.222
Add tun interface
ip tuntap add dev tun0 mode tun user <someuser>
Setup the tun interface
sudo ifconfig tun0 10.0.0.1 netmask 255.255.255.0
run tun2socks
badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:1080
if your DNS is a remote one add a route to it with a lower metric than the tun one (lower than metric on step 8)
route add 208.67.222.222 gw 192.168.1.1 metric 4
Add a route for your ssh server not 127.0.0.1
route add 222.x.x.222 gw 192.168.1.1 metric 4
Add a default route to forward everything to the tun
route add default gw 10.0.0.2 metric 6
Your mistake was 127.0.0.1
i guess your ssh server is remote not running on 127.0.0.1
...
add a comment |
Here are the proper steps:
First check if your DNS is a remote one or a local one
cat /etc/resolv.conf
if it's a local one like192.168.1.1
it does not a matter but if the DNS is remote for example208.67.222.222
you need to add a route for it (see below)
Connect to your ssh server
ssh -N -C -D 8080 user@222.x.x.222
Add tun interface
ip tuntap add dev tun0 mode tun user <someuser>
Setup the tun interface
sudo ifconfig tun0 10.0.0.1 netmask 255.255.255.0
run tun2socks
badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:1080
if your DNS is a remote one add a route to it with a lower metric than the tun one (lower than metric on step 8)
route add 208.67.222.222 gw 192.168.1.1 metric 4
Add a route for your ssh server not 127.0.0.1
route add 222.x.x.222 gw 192.168.1.1 metric 4
Add a default route to forward everything to the tun
route add default gw 10.0.0.2 metric 6
Your mistake was 127.0.0.1
i guess your ssh server is remote not running on 127.0.0.1
...
Here are the proper steps:
First check if your DNS is a remote one or a local one
cat /etc/resolv.conf
if it's a local one like192.168.1.1
it does not a matter but if the DNS is remote for example208.67.222.222
you need to add a route for it (see below)
Connect to your ssh server
ssh -N -C -D 8080 user@222.x.x.222
Add tun interface
ip tuntap add dev tun0 mode tun user <someuser>
Setup the tun interface
sudo ifconfig tun0 10.0.0.1 netmask 255.255.255.0
run tun2socks
badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:1080
if your DNS is a remote one add a route to it with a lower metric than the tun one (lower than metric on step 8)
route add 208.67.222.222 gw 192.168.1.1 metric 4
Add a route for your ssh server not 127.0.0.1
route add 222.x.x.222 gw 192.168.1.1 metric 4
Add a default route to forward everything to the tun
route add default gw 10.0.0.2 metric 6
Your mistake was 127.0.0.1
i guess your ssh server is remote not running on 127.0.0.1
...
answered 58 mins ago
intikaintika
1925
1925
add a comment |
add a comment |
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.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f271167%2ftun2socks-badvpn-having-trouble-with-setup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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
Would you mind posting a link about tun2vpn? cant find it in google.
– Rui F Ribeiro
Mar 21 '16 at 11:05
Oops, it is tun2socks (badvpn): github.com/ambrop72/badvpn
– Walter
Mar 21 '16 at 18:57