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

2 local bridge interface create #37

Closed ilyamen closed 1 year ago

ilyamen commented 1 year ago

hello, how can I create two vpn hubs with dnsmasq and run the network interface for example name "soft1" at the same time

cenk1cenk2 commented 1 year ago

So you want to bridge to hubs together I preassume. I do not think this is automatically possible to configure maybe will be possible by hand.

As I understand it if you want two seperate hubs you can manually configure the dnsmasq.conf as a persistent file and mount it in configuration folder. But the container is not configured to create multiple tap adapters so that can hit a wall quickly.

ilyamen commented 1 year ago

I created 2 hubs and made 2 local bridges for it, duplicated the settings in the dnsmasq configuration file and edited them for 2 interfaces. after restarting the container, I executed "ip address add 10.8.0.1/24 dev tap_soft1" now devices can connect and get ip. But I don't have Internet access, I'm trying to figure out why. Are there any other actions that need to be performed?

cenk1cenk2 commented 1 year ago

This is the last part.

This is not very sustainable in the sense that I suppose it would be gone whenever the container is restarted, but maybe we can add post scripts where it executes your scripts after the default setup has run and just before services start like many other containers.

Please inform me further if this is working and adding something like this would be a good solution for you too.

ilyamen commented 1 year ago

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE This command works. How can we implement data automation of 2 commands?

cenk1cenk2 commented 1 year ago

Cool we can add a mechanism to execute user scripts as hooks at the right time. So this should just be before the starting of the services and after the confoguration has finished.

I will add it and inform you back but it might take a while since currently I am mostly swamped.

cenk1cenk2 commented 1 year ago

Please check out the brief description on hooks where you can add your script as an executable to a certain location to fire whenever the appropriate time comes. Here you can add the manual commands you did to get it working so that it would fire every time the container starts.