-
Notifications
You must be signed in to change notification settings - Fork 109
Hard coding "eth0" causes an issue when using podman #93
Comments
As pointed out elsewhere, the optimal solution is to accept In place of |
I'm not too familiar with the subtle differences between Podman and Docker. I assume this is rootless Podman? I'd like to play with it myself. |
I'm late to the entire container game. :) ... better late than never. I started learning about Below is a raw shell script that I'm using during test. You can see the similarities with My plan is to eventually get a PR for an .md with Thx! #!/bin/bash
ENV_FILE="$HOME/.VPN/container.env"
# Proxy port maps
LOCAL_HTTP_PROXY_PORT=8080
LOCAL_SOCKS_PROXY_PORT=1080
podman run --name VPN \
--detach \
--privileged \
--name=openvpn-client \
--env-file=$ENV_FILE \
--env TAP="tap0" \
--env RETRY=2 \
--env MAX_RETRY=10 \
--publish $LOCAL_HTTP_PROXY_PORT:8080 \
--publish $LOCAL_SOCKS_PROXY_PORT:1080 \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
--tz=local \
--volume $HOME/.VPN:/data/vpn \
--volume $HOME/.VPN:/run/secrets \
ghcr.io/wfg/openvpn-client |
This is very dangerous actually: my result was complete removable of default gateway and lost networking. I don't know if this was because of debian 11 defaults to using enp2s0 style device handles, or because my hardware happened to have 2 network ports, enp3s0 is the second one. But yes using hardcoded eth0 seems risky for many systems. It was very confusing because the first error message is about ghcr.io "networking not available" which makes you think it never even pulled the image. At first I assumed the logical thing to do was install this and test exactly how it acts with no vpn credentials : and I thought the killswitch would only affect anything using the docker networking. This is not the case, the killswitch is in the HOST operating system so it also affects everything outside docker networking too. The only reason I even suspected this was the killswitch was because i could still ping the indicated "subnet" but not 1.1.1.1. I will investigate further if the "eth0" is the only problem going on here for this type of system |
Hi @cdeadlock , I couldn't replicate your issue with the latest test bits. If you are using If you are not using In my environment, I set up my VM with two NICs:
With the new log output, we can see that the container only has one NIC. Furthermore, you can see that the log says that I have remapped
|
Here's the output when it is not remapped. As I'm using
|
Hi,
As mentioned in #87, when the container is run via
podman
, the network device istun0
rather than the hard codedeth0
.Perhaps adding smarts to
entry.sh
to determine the tap. Below is an example that I added to my local copy ofentry.sh
- seeTAP=...
For context, I am providing some lines surrounding where I believe it should go.I also globally
^eth0^$TAP^
The text was updated successfully, but these errors were encountered: