diff --git a/config/ocserv.conf b/config/ocserv.conf index fdcb182..edf822b 100644 --- a/config/ocserv.conf +++ b/config/ocserv.conf @@ -487,7 +487,7 @@ default-domain = example.ru # Note that, you could use addresses from a subnet of your LAN network if you # enable [proxy arp in the LAN interface](http://ocserv.openconnect-vpn.net/recipes-ocserv-pseudo-bridge.html); # in that case it is recommended to set ping-leases to true. -ipv4-network = 192.168.1.0 +ipv4-network = 10.0.2.0 ipv4-netmask = 255.255.255.0 # An alternative way of specifying the network: diff --git a/scripts/start_ad.sh b/scripts/start_ad.sh index bc84c27..b0c0d0c 100644 --- a/scripts/start_ad.sh +++ b/scripts/start_ad.sh @@ -1,4 +1,5 @@ route add -net 10.0.1.0 netmask 255.255.255.0 gw wg +route add -net 10.0.2.0 netmask 255.255.255.0 gw oc cat /ssh/key.pub > /root/.ssh/authorized_keys ssh-keygen -A exec /usr/sbin/sshd -D -e "$@" & diff --git a/scripts/start_oc.sh b/scripts/start_oc.sh index 29a2310..1856a97 100644 --- a/scripts/start_oc.sh +++ b/scripts/start_oc.sh @@ -1,9 +1,11 @@ +INTERFACE=$(route | grep '^default' | grep -o '[^ ]*$') cat /ssh/key.pub > /root/.ssh/authorized_keys ssh-keygen -A exec /usr/sbin/sshd -D -e "$@" & mkdir -p /dev/net mknod /dev/net/tun c 10 200 chmod 600 /dev/net/tun -iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +iptables -t nat -A POSTROUTING --destination 10.10.0.5 -j ACCEPT +iptables -t nat -A POSTROUTING -o $INTERFACE -j MASQUERADE ocserv -c /etc/ocserv/ocserv.conf tail -f /dev/null