X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=topo.py;h=a9a9853ef9b5c91577f8d95050429b62089d5a79;hb=f6ed4fcd49097356b5f23143e1df6fc7eb20dcb4;hp=e142802772f22312d41298905c439a19f52ab4b9;hpb=1b5940a1a58122ab437c3b2dfe0794bbf01118c7;p=nodemanager-topo.git diff --git a/topo.py b/topo.py index e142802..a9a9853 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 ! @@ -326,6 +338,7 @@ def update_hosts(slicename, hosts): def start(options, config): + run ("echo 1 > /proc/sys/net/ipv4/ip_forward") pass