[vpn] Tunnel entre soyouz et odlyd
This commit is contained in:
parent
7d09c5fb03
commit
81f1459b59
13 changed files with 41 additions and 83 deletions
|
@ -1,4 +1,4 @@
|
||||||
ovh.vpn.crans.org
|
oyoustart.vpn.crans.org
|
||||||
soyoustart.vpn.crans.org
|
|
||||||
komaz.vpn.crans.org
|
komaz.vpn.crans.org
|
||||||
|
odlyd.vpn.crans.org
|
||||||
freebox.vpn.crans.org
|
freebox.vpn.crans.org
|
||||||
|
|
4
Cfg/etc/openvpn/arp_proxy_soyouz/arp_proxy_soyouz
Normal file
4
Cfg/etc/openvpn/arp_proxy_soyouz/arp_proxy_soyouz
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sysctl net.ipv4.conf.tun-soyouz.forwarding=1
|
||||||
|
arp -i crans.2 -Ds 10.231.136.108 crans.2 pub
|
3
Cfg/etc/openvpn/arp_proxy_soyouz/info.xml
Normal file
3
Cfg/etc/openvpn/arp_proxy_soyouz/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<FileInfo>
|
||||||
|
<Info owner='root' group='root' perms='0744'/>
|
||||||
|
</FileInfo>
|
4
Cfg/etc/openvpn/arp_unproxy_soyouz/arp_unproxy_soyouz
Normal file
4
Cfg/etc/openvpn/arp_unproxy_soyouz/arp_unproxy_soyouz
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
arp -i crans.2 -d 10.231.136.108 pub
|
||||||
|
sysctl net.ipv4.conf.tun-soyouz.forwarding=0
|
3
Cfg/etc/openvpn/arp_unproxy_soyouz/info.xml
Normal file
3
Cfg/etc/openvpn/arp_unproxy_soyouz/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<FileInfo>
|
||||||
|
<Info owner='root' group='root' perms='0744'/>
|
||||||
|
</FileInfo>
|
|
@ -1,30 +0,0 @@
|
||||||
# Fichier gere par BCfg2 avec le plugin Cfg
|
|
||||||
#
|
|
||||||
# Configuration du vpn entre komaz/titanic et ovh
|
|
||||||
|
|
||||||
daemon tun-ovh
|
|
||||||
dev tun-ovh
|
|
||||||
|
|
||||||
mode server
|
|
||||||
tls-server
|
|
||||||
ca /etc/ssl/certs/cacert.org.pem
|
|
||||||
cert /etc/ssl/certs/vpn.pem
|
|
||||||
tls-verify "/usr/scripts/utils/verify-cn /etc/openvpn/allowed_clients"
|
|
||||||
key /etc/ssl/private/vpn.pem
|
|
||||||
|
|
||||||
log-append /var/log/openvpn/ovh.log
|
|
||||||
|
|
||||||
port 1194
|
|
||||||
fragment 1400
|
|
||||||
|
|
||||||
# Du cote crans, le vpn reste toujours actif
|
|
||||||
keepalive 15 45
|
|
||||||
persist-tun
|
|
||||||
|
|
||||||
verb 3
|
|
||||||
|
|
||||||
dh /etc/openvpn/dh1024.pem
|
|
||||||
|
|
||||||
# Configuration du reseau lorsque ovh se connecte
|
|
||||||
client-connect /etc/openvpn/ovh.connect
|
|
||||||
client-disconnect /etc/openvpn/ovh.disconnect
|
|
|
@ -1,3 +0,0 @@
|
||||||
<FileInfo>
|
|
||||||
<Info owner='root' group='root' perms='0755'/>
|
|
||||||
</FileInfo>
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Fichier gere par BCfg2 avec le plugin Cfg
|
|
||||||
#
|
|
||||||
# Configuration lorsque ovh se connecte via se point du reseau (komaz
|
|
||||||
# ou titanic)
|
|
||||||
case $common_name in
|
|
||||||
ovh.vpn.crans.org)
|
|
||||||
echo "ovh connected"
|
|
||||||
ovh_ip=10.231.136.8
|
|
||||||
;;
|
|
||||||
soyoustart.vpn.crans.org)
|
|
||||||
echo "soyoustart connected"
|
|
||||||
ovh_ip=10.231.136.108
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
iface=$(/sbin/route -n|awk '$1 == "10.231.136.0" {print $8}')
|
|
||||||
my_ip=$(ip addr show dev $iface|awk '$1 == "inet" {sub("/.*", "", $2); print $2}')
|
|
||||||
|
|
||||||
ip addr add $my_ip peer $ovh_ip/32 dev tun-ovh
|
|
||||||
ip link set up dev tun-ovh
|
|
||||||
ip neigh add proxy $ovh_ip dev $iface
|
|
||||||
|
|
||||||
cat > $1 <<EOF
|
|
||||||
ifconfig-push $ovh_ip 255.255.255.0
|
|
||||||
EOF
|
|
|
@ -1,3 +0,0 @@
|
||||||
<FileInfo>
|
|
||||||
<Info owner='root' group='root' perms='0755'/>
|
|
||||||
</FileInfo>
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Fichier gere par BCfg2 avec le plugin Cfg
|
|
||||||
#
|
|
||||||
# Configuration lorsque la connexion avec ovh est perdue
|
|
||||||
|
|
||||||
echo "$common_name disconnected"
|
|
||||||
|
|
||||||
iface=$(/sbin/route -n|awk '$1 == "10.231.136.0" {print $8}')
|
|
||||||
ovh_ip=$ifconfig_pool_remote_ip
|
|
||||||
|
|
||||||
ip neigh del proxy $ovh_ip dev $iface
|
|
||||||
ip link set down dev tun-ovh
|
|
3
Cfg/etc/openvpn/soyouz.conf/info.xml
Normal file
3
Cfg/etc/openvpn/soyouz.conf/info.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<FileInfo>
|
||||||
|
<Info owner='root' group='root' perms='0644'/>
|
||||||
|
</FileInfo>
|
20
Cfg/etc/openvpn/soyouz.conf/soyouz.conf
Normal file
20
Cfg/etc/openvpn/soyouz.conf/soyouz.conf
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
proto udp
|
||||||
|
|
||||||
|
dev tun-soyouz
|
||||||
|
ca /etc/ssl/certs/cacert.org.pem
|
||||||
|
cert /etc/ssl/certs/vpn.pem
|
||||||
|
key /etc/ssl/private/vpn.pem
|
||||||
|
|
||||||
|
dh /etc/openvpn/dh1024.pem
|
||||||
|
persist-tun
|
||||||
|
keepalive 15 45
|
||||||
|
ifconfig 10.231.136.4 10.231.136.108
|
||||||
|
|
||||||
|
port 1194
|
||||||
|
fragment 1400
|
||||||
|
tls-server
|
||||||
|
tls-verify "/usr/scripts/utils/verify-cn /etc/openvpn/allowed_clients"
|
||||||
|
|
||||||
|
log-append /var/log/openvpn/soyouz.log
|
||||||
|
up ./arp_proxy_soyouz
|
||||||
|
down ./arp_unproxy_soyouz
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- coding: utf-8; mode: python -*-
|
# -*- coding: utf-8; mode: python -*-
|
||||||
|
|
||||||
remote="komaz"
|
remote="odlyd"
|
||||||
remote_vpn="komaz"
|
remote_vpn="odlyd"
|
||||||
dump("template/openvpn")
|
dump("template/openvpn")
|
Loading…
Add table
Add a link
Reference in a new issue