Commit d19b9e2b authored by Ulysse Beaugnon's avatar Ulysse Beaugnon

Merge branch 'master' of https://git.erp5.org/repos/vifibnet

Conflicts:
	vifibnet.py
parents e25ef3f0 e3464a00
......@@ -29,9 +29,9 @@ def server(ip, pipe_fd, *args, **kw):
return openvpn(
'--tls-server',
'--mode', 'server',
'--up', 'up-server %s/%u' % (ip, len(utils.config.vifibnet)),
'--client-connect', 'client-connect ' + str(pipe_fd),
'--client-disconnect', 'client-connect ' + str(pipe_fd),
'--up', 'openvpn-up-server %s/%u' % (ip, len(utils.config.vifibnet)),
'--client-connect', 'openvpn-server-events ' + str(pipe_fd),
'--client-disconnect', 'openvpn-server-events ' + str(pipe_fd),
'--dh', utils.config.dh,
'--max-clients', str(utils.config.max_clients),
*args, **kw)
......@@ -41,7 +41,29 @@ def client(serverIp, pipe_fd, *args, **kw):
'--nobind',
'--client',
'--remote', serverIp,
'--up', 'up-client',
'--route-up', 'route-up ' + str(pipe_fd),
'--up', 'openvpn-up-client',
'--route-up', 'openvpn-route-up ' + str(pipe_fd),
*args, **kw)
def startBabel(**kw):
args = ['babeld',
'-C', 'redistribute local ip %s' % (utils.config.internal_ip),
'-C', 'redistribute local deny',
# Route VIFIB ip adresses
'-C', 'in ip %s::/%u' % (utils.ipFromBin(utils.config.vifibnet), len(utils.config.vifibnet)),
# Route only addresse in the 'local' network,
# or other entire networks
#'-C', 'in ip %s' % (config.internal_ip),
#'-C', 'in ip ::/0 le %s' % network_mask,
# Don't route other addresses
'-C', 'in deny',
'-d', str(utils.config.verbose),
'-s',
]
if utils.config.babel_state:
args += '-S', utils.config.babel_state
args = args + ['vifibnet'] + list(tunnelmanager.free_interface_set)
if utils.config.verbose >= 5:
print args
return subprocess.Popen(args, **kw)
#!/usr/bin/env python
import argparse, errno, math, os, select, subprocess, sys, time
import argparse, errno, math, os, select, subprocess, sys, time, traceback
from OpenSSL import crypto
import traceback
import upnpigd
import openvpn
import utils
import db
import tunnelmanager
def startBabel(**kw):
args = ['babeld',
'-C', 'redistribute local ip %s' % (utils.config.internal_ip),
'-C', 'redistribute local deny',
# Route VIFIB ip adresses
'-C', 'in ip %s::/%u' % (utils.ipFromBin(utils.config.vifibnet), len(utils.config.vifibnet)),
# Route only addresse in the 'local' network,
# or other entire networks
#'-C', 'in ip %s' % (config.internal_ip),
#'-C', 'in ip ::/0 le %s' % network_mask,
# Don't route other addresses
'-C', 'in deny',
'-d', str(utils.config.verbose),
'-s',
]
if utils.config.babel_state:
args += '-S', utils.config.babel_state
args = args + ['vifibnet'] + list(tunnelmanager.free_interface_set)
if utils.config.verbose >= 5:
print args
return subprocess.Popen(args, **kw)
import db, openvpn, upnpigd, utils, tunnelmanager
def handle_message(msg):
script_type, arg = msg.split()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment