Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Forwarding Not Working #239

Closed
itzTheMeow opened this issue Oct 7, 2023 · 4 comments
Closed

Port Forwarding Not Working #239

itzTheMeow opened this issue Oct 7, 2023 · 4 comments

Comments

@itzTheMeow
Copy link

I am running a simple node.js webserver script on port 8777:

const app = require("express")();
app.get("/", (_, res) => res.send("OK"));
app.listen(8777, () => console.log("ok, listening"));

Running node . without vopono:

ok, listening

image

Running vopono -v exec --firewall iptables -f 8777 "node ." :

 2023-10-07T07:01:51.139Z DEBUG vopono_core::util > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:51.139Z DEBUG vopono_core::util > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:51.140Z DEBUG vopono_core::util > Cleaning dead lock files...
 2023-10-07T07:01:52.140Z DEBUG vopono            > pactl not found, will not set PULSE_SERVER
 2023-10-07T07:01:52.140Z WARN  vopono_core::util > Running vopono as root user directly!
 2023-10-07T07:01:52.140Z DEBUG vopono_core::util > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.140Z DEBUG vopono_core::util > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.147Z DEBUG vopono_core::util > Existing namespaces: ["vo_mv_usa"]
 2023-10-07T07:01:52.147Z DEBUG vopono_core::util > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.147Z DEBUG vopono_core::util > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.147Z DEBUG vopono_core::util > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.147Z DEBUG vopono_core::util > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "custom_config" not found
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "custom_netns_name" not found
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "open_hosts" not found
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "allow_host_access" not found
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "postup" not found
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "predown" not found
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "user" not found
 2023-10-07T07:01:52.147Z DEBUG vopono::exec      > vopono config.toml: configuration property "group" not found
 2023-10-07T07:01:52.148Z DEBUG vopono::exec      > vopono config.toml: configuration property "working-directory" not found
 2023-10-07T07:01:52.148Z DEBUG vopono::exec      > vopono config.toml: configuration property "dns" not found
 2023-10-07T07:01:52.148Z DEBUG vopono_core::util > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.148Z DEBUG vopono_core::util > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.148Z DEBUG vopono::exec      > vopono config.toml: configuration property "interface" not found
 2023-10-07T07:01:52.148Z DEBUG vopono_core::network::network_interface > ip addr
 2023-10-07T07:01:52.156Z WARN  vopono::exec                            > Multiple network interfaces are active: [
    "enp1s0",
    "br-8f7252aba556",
    "docker0",
    "br-mailcow",
    "br-0e510fdd732c",
    "br-269145f3d786",
    "pterodactyl0",
    "veth477ab02@if9",
    "veth61421d2@if11",
    "vethea813c5@if13",
    "vethb3bc388@if15",
    "vetha9716b4@if17",
    "veth4d27fe4@if19",
    "veth51b5163@if21",
    "veth3faeb28@if23",
    "vethcf978ef@if25",
    "vethd8fc47c@if27",
    "vetha7f7bfb@if29",
    "veth15272a3@if31",
    "veth0fd5f4e@if33",
    "veth5ef2b84@if35",
    "vetheda5c79@if37",
    "vethf43c637@if39",
    "veth3816a74@if41",
    "veth9fc4c05@if43",
    "veth7188115@if45",
    "veth6fa7b1b@if47",
    "vetha0655ca@if49",
    "veth34e4354@if51",
    "veth37c019f@if53",
    "veth2533241@if55",
    "vethcf274aa@if59",
    "veth8ff0df9@if61",
    "veth16d6181@if63",
    "vo_mv_usa_d@if142",
], consider specifying the interface with the -i argument. Using enp1s0
 2023-10-07T07:01:52.156Z DEBUG vopono::exec                            > Interface: enp1s0
 2023-10-07T07:01:52.156Z DEBUG vopono_core::util                       > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.156Z DEBUG vopono_core::util                       > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.161Z INFO  vopono_core::util                       > Chosen config: /root/.config/vopono/mv/wireguard/usa-usden101.conf
 2023-10-07T07:01:52.167Z DEBUG vopono_core::util                       > Existing namespaces: ["vo_mv_usa"]
 2023-10-07T07:01:52.167Z INFO  vopono::exec                            > Using existing namespace: vo_mv_usa, will not modify firewall rules
 2023-10-07T07:01:52.167Z DEBUG vopono_core::util                       > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.167Z DEBUG vopono_core::util                       > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.167Z DEBUG vopono_core::network::netns             > Trying to read lockfile: /root/.config/vopono/locks/vo_mv_usa
 2023-10-07T07:01:52.167Z INFO  vopono_core::network::netns             > Using existing network namespace: vo_mv_usa
 2023-10-07T07:01:52.167Z DEBUG vopono_core::util                       > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.167Z DEBUG vopono_core::util                       > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.167Z DEBUG vopono_core::network::netns             > Writing lockfile: /root/.config/vopono/locks/vo_mv_usa
 2023-10-07T07:01:52.168Z DEBUG vopono_core::network::netns             > Lockfile written: /root/.config/vopono/locks/vo_mv_usa/1463385
 2023-10-07T07:01:52.168Z DEBUG vopono_core::util                       > Using config dir from $HOME config: /root/.config
 2023-10-07T07:01:52.168Z DEBUG vopono_core::util                       > Using config dir from XDG dirs: /root/.config
 2023-10-07T07:01:52.593Z DEBUG vopono_core::network::netns             > ip netns exec vo_mv_usa node .
 2023-10-07T07:01:52.594Z DEBUG vopono::exec                            > Forwarding port: 8777, 10.200.1.2
 2023-10-07T07:01:52.594Z INFO  vopono::exec                            > Application node . launched in network namespace vo_mv_usa with pid 1463433
ok, listening
 2023-10-07T07:01:57.996Z DEBUG basic_tcp_proxy                         > New connection

I noticed basic_tcp_proxy says it received a new connection, however I'm not getting anything in the web browser.
image

enp1s0 is the correct interface:

$ route                                                                                                                   
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    0      0        0 enp1s0
10.200.1.0      0.0.0.0         255.255.255.0   U     0      0        0 vo_mv_usa_d
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 pterodactyl0
172.19.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-269145f3d786
172.22.1.0      0.0.0.0         255.255.255.0   U     0      0        0 br-mailcow
172.23.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-0e510fdd732c
172.29.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-8f7252aba556
_gateway        0.0.0.0         255.255.255.255 UH    0      0        0 enp1s0

I also tried changing the bind address to be specifically 10.200.1.2 from the debug log, which did not work.

app.listen(8777, "10.200.1.2", () => console.log("ok, listening"))
@jamesmcm
Copy link
Owner

Your test code works fine for me 🤔

Are you sure nothing else is interfering like ufw, etc. ?

@itzTheMeow
Copy link
Author

I noticed that Mullvad doesn't support port forwarding, I think that's that issue.

@itzTheMeow
Copy link
Author

#226 being the reference

@jamesmcm
Copy link
Owner

Yeah, sorry I thought you were accessing it on the same host, if it's hosted externally then that is the issue for sure.

@itzTheMeow itzTheMeow closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants