Fix for OpenVPN support
authorAndy Bavier <acb@cs.princeton.edu>
Fri, 27 Mar 2009 18:22:15 +0000 (18:22 +0000)
committerAndy Bavier <acb@cs.princeton.edu>
Fri, 27 Mar 2009 18:22:15 +0000 (18:22 +0000)
NodeManager-topo.spec
topo.py

index 78371bf..3b0d4bf 100644 (file)
@@ -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 (executable)
--- 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 d<key>x<nodeid>
 """
@@ -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<key>
 """
@@ -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
 !