Commit 938da7ea authored by Guillaume Bury's avatar Guillaume Bury

Bootstrap peer fixed in registry

parent c899b4ec
......@@ -154,7 +154,7 @@ OPTIONS : VIFIBNET.PY
line, vifibnet will attempt to forward a port with upnp for each
couple port/proto given.
Protocols should be either udp or tcp-server.
Default : (1194, udp)
Default : (1194, udp), (1194, tcp-server)
--tunnel-refresh duration
Interval in seconds between two tunnel refresh. Refreshing tunnels
......
Name ideas :
resnet ( for Resiliable NET )
rsnet ( Resiliable Scalable NET )
To be done :
use the server as a bootstrap node -> switch peer discovery to be done
by vifibnet directly ?
......
......@@ -53,6 +53,9 @@ class main(object):
help='Path to certificate key')
_('--mailhost', required=True,
help='SMTP server mail host')
_('--bootstrap', required=True, nargs=4,
help='''VPN prefix, ip address, port and protocol to send as
bootstrap peer''')
self.config = parser.parse_args()
# Database initializing
......@@ -178,7 +181,8 @@ class main(object):
# TODO: Insert a flag column for bootstrap ready servers in peers
# ( servers which shouldn't go down or change ip and port as opposed to servers owned by particulars )
# that way, we also ascertain that the server sent is not the new node....
prefix, address = self.db.execute("SELECT prefix, address FROM peers ORDER BY random() LIMIT 1").next()
prefix = self.config.bootstrap[0]
address = ','.join(self.config.bootstrap[1:])
print "Sending bootstrap peer (%s, %s)" % (prefix, str(address))
return prefix, address
......
......@@ -174,3 +174,4 @@ class TunnelManager:
utils.log('Routes on iface %s : %s' % (
self._connection_dict[p].iface,
self._connection_dict[p].routes), 5)
......@@ -85,7 +85,7 @@ def main():
# Get arguments
config = getConfig()
if not config.pp:
config.pp = [['1194', 'udp']]
config.pp = [['1194', 'udp'], ['1194', 'tcp-server']]
manual = bool(config.address)
network = utils.networkFromCa(config.ca)
internal_ip, prefix = utils.ipFromCert(network, config.cert)
......
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