Closed elsin16 closed 1 year ago
Since is failing on trying to create a tap adapter, can you try to execute that ip tuntap add dev tap_soft0 mode tap
command directly on the host to see if it is possible.
It might be that the host system does not have the tun device node.
The steps to enable it can also be seen on the container itself as a reference. https://github.com/cenk1cenk2/docker-softether-vpnsrv/blob/5b809e2dc3129569cdf3248c9dac0d8270a44189/Dockerfile-ubuntu#L50
As I understand it, Docker Swarm does not know how to handle the Device section, so I moved '/dev/net/tun' to the Volumes section.
version: '3.8'
services:
softether:
image: cenk1cenk2/softether-vpnsrv:latest-ubuntu
cap_add:
- SETGID
- SETUID
- NET_ADMIN
- NET_RAW
- NET_BIND_SERVICE
restart: always
network_mode: bridge
environment:
SERVER_MODE: 'bridge'
SOFTETHER_TAP_INTERFACE: 'soft0'
ports:
- 53:53
- 443:443
- 992:992
- 1194:1194/udp
- 5555:5555
- 8888:8888
- 500:500/udp
- 4500:4500/udp
- 1701:1701/udp
volumes:
- '/etc/localtime:/etc/localtime:ro'
- '/etc/timezone:/etc/timezone:ro'
- '/docker_local/softether_test:/conf'
- '/dev/net/tun:/dev/net/tun'
deploy:
replicas: 1
placement:
constraints: [node.hostname==node02]
The container has created a Tap interface, but a new error has appeared
docker-softether-vpnsrv - BUILD.20221206Z1031
---------------------------------------------
[I] [conf:softether] Persistent configuration file found: /conf/vpn_server.config
[I] [postrouting] Created postrouting rules for: 10.0.0.0/24
[I] [interface:tap] Created tap adapter: tap_soft0
[E] [interface:bridge] [FAIL] $ brctl delbr br100 > exec: "brctl": executable file not found in $PATH
[E] [interface:bridge] exec: "brctl": executable file not found in $PATH
[F] [interface:bridge] exec: "brctl": executable file not found in $PATH
[E] [terminate:interface:tap] exec: "brctl": executable file not found in $PATH
[W] [docker-softether-vpnsrv] [terminate] Forcefully terminated since hooks did not finish in time: 1 of 2
probably there is not enough bridge-utils package in the container
Docker Swarm might do that due to clustered approach possibly so makes sense.
Great that is interesting that it works without the kernel module but also makes a bit sense.
Ubuntu container came as a pull request so i suppose I have not checked it properly in bridge mode. So it would be as easy as adding the missing package hopefully.
Thanks for the quick answers! Now the isc-dhcp-client is missing :)
docker-softether-vpnsrv - BUILD.20221206Z1150
---------------------------------------------
[I] [conf:softether] Persistent configuration file found: /conf/vpn_server.config
[I] [postrouting] Created postrouting rules for: 172.23.168.0/23
[I] [interface:tap] Created tap adapter: tap_soft
[I] [interface:bridge] Created bridge adapter: br100 -> tap_soft eth0
[E] [interface:bridge:dhcp] [FAIL] $ dhclient -v br100 > exec: "dhclient": executable file not found in $PATH
[E] [interface:bridge:dhcp] exec: "dhclient": executable file not found in $PATH
[F] [interface:bridge:dhcp] exec: "dhclient": executable file not found in $PATH
[E] [terminate:interface:tap] exec: "dhclient": executable file not found in $PATH
[W] [docker-softether-vpnsrv] [terminate] Forcefully terminated since hooks did not finish in time: 1 of 2
As a quickfix added a new build. Sorry that did not have enough time to properly test everything.
If that resolved the given issue, I can close this for now.
Hi! I'm trying to build a container bridge My system: Ubuntu 22.04 Docker Swarm 20.10.21
My compose file:
but when creating a container, an error appears in the logs:
Tell me what I'm doing wrong. How to launch a container?)