From e0ef68a4f4784d3bcb13a688650e79aec099980c Mon Sep 17 00:00:00 2001 From: Andy Bavier Date: Fri, 27 Mar 2009 18:22:15 +0000 Subject: [PATCH] Fix for OpenVPN support --- NodeManager-topo.spec | 2 +- topo.py | 34 +++++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/NodeManager-topo.spec b/NodeManager-topo.spec index 78371bf..3b0d4bf 100644 --- a/NodeManager-topo.spec +++ b/NodeManager-topo.spec @@ -2,7 +2,7 @@ Name: NodeManager-topo Version: 0.3 -Release: 2 +Release: 3 Summary: Plugin supporting creating a default virtual topology. Group: System Environment/Daemons diff --git a/topo.py b/topo.py index e142802..7bf8bf7 100755 --- a/topo.py +++ b/topo.py @@ -31,6 +31,13 @@ def run(cmd): return subprocess.call(cmd, shell=True); +""" +Subnet used for virtual interfaces by setup-egre-link script +""" +def iias_network(): + return "192.168.0.0 255.255.0.0" + + """ Check for existence of interface dx """ @@ -71,6 +78,14 @@ def refresh_virtual_link(nodeid, key): return +""" +IP address of the NAT interface created inside the slice by the +setup-nat script. +""" +def nat_inner_ip(key): + return "10.0.%s.2" % key + + """ Check for existence of interface natx """ @@ -211,17 +226,16 @@ password %s """ -Network used by OpenVPN on this node +IP address of NAT gateway to outside world """ -def openvpn_net(myid): - return "10.%s.0.0/16" % myid - +def nat_gw(key): + return "10.0.%s.1" % key """ -IP address of NAT gateway to outside world +IP address of the NAT interface inside the slice """ -def nat_gw(key, myid): - return "10.%s.%s.1" % (key, myid) +def nat_inner(key): + return "10.0.%s.2" % key """ @@ -241,13 +255,11 @@ link-detect """ % name) f.write ("""! -ip route %s %s -! access-list vty permit 127.0.0.1/32 ! line vty ! -""" % (openvpn_net(myid), nat_gw(key, myid))) +""") f.close() return @@ -281,7 +293,7 @@ def write_ospf(filename, myname, ifaces): net = ifaces[name]['network'] f.write (" network %s area 0\n" % net) - f.write(""" redistribute static + f.write(""" redistribute kernel ! access-list vty permit 127.0.0.1/32 ! -- 2.43.0