cenk1cenk2 / docker-softether-vpnsrv

SoftEther VPN Server with DNSMASQ DHCP Server or bridge mode connection for VPN-to-site setup.
29 stars 15 forks source link

sorry again #30

Closed Dewtah closed 1 year ago

Dewtah commented 1 year ago

Sorry to bother you again,

whatever I try, I get

failed to create endpoint mystifying_franklin on network bridge: adding interface vethd652ad6 to bridge docker0 failed: could not find bridge docker0: route ip+net: no such network interface

At step 6. And can't seem to find anywhere where it is defined. Is this inherent to your building environment? Because my assumption was that the var LINUX_BRIDGE_INTERFACE_NAME: 'bridge' should be covering that.

ive tried to add in constants.go in the flags.co as .env and as environment in the docker-compose.yml

Dewtah commented 1 year ago

My bad i didn't see the comments below the docker hub. And the second repo needed for this.

cenk1cenk2 commented 1 year ago

Hey @Dewtah,

I do not actually understand the update message but the first one can be because you may need to use host network_mode in your container to directly bridge it to an interface.

If the environment variables are properly field-matching your upstream interface it should work in any case. The LINUX_BRIDGE_INTERFACE_NAME is the bridge interface that it creates, it should not existing in your environment and will be created for the instance of the container, so something that would not collide like br100 will serve fine.

This is the bridge setup i use in the testing.

SERVER_MODE=bridge
LOG_LEVEL=trace
LINUX_BRIDGE_UPSTREAM_INTERFACE=enp2s0
LINUX_BRIDGE_INTERFACE_NAME=br100
SOFTETHER_DEFAULT_HUB=VPN

with a docker-compose file like,

version: '3.7'
services:
  softether-vpnsrv:
    image: cenk1cenk2/softether-vpnsrv:latest
    env_file: .env
    devices:
      - /dev/net/tun
    ports:
      - 1443:1443/tcp
      - 992:992/tcp
      - 5555:5555/tcp
      - 1194:1194/udp
      - 500:500/udp
      - 4500:4500/udp
      - 1701:1701/tcp
    network_mode: host
    volumes:
      # Configuration Files
      - ./volumes/softether-vpnsrv:/conf
      # Log files
      - ./logs/server_log:/etc/softether/server_log
      - ./logs/security_log:/etc/softether/security_log
      - ./logs/packet_log:/etc/softether/packet_log
    cap_add:
      - SETGID
      - SETUID
      - NET_ADMIN
      - NET_RAW
      - NET_BIND_SERVICE