Commit cc56cd2a authored by Joanne Hugé's avatar Joanne Hugé

Change ip addresses

parent 51f640de
......@@ -8,8 +8,8 @@ import thread
IPTABLES = 'iptables'
SCREEN = 'screen'
VERBOSE = 4
REGISTRY = '10.0.0.2'
REGISTRY2 = '10.3.0.2'
REGISTRY = '193.0.0.2'
REGISTRY2 = '193.3.0.2'
REGISTRY_SERIAL = '0x120010db80042'
REGISTRY2_SERIAL = '0x120010db80043'
CA_DAYS = 1000
......@@ -29,15 +29,15 @@ with open(os.devnull, "wb") as f:
#
# registry .2------ ------.2 registry2
# | |
# 10.0.0| |10.3.0
# 193.0.0| |193.3.0
# .1 | |.1
# ---------------Internet----------------
# |.1 |.1 |.1
# |10.1.0 |10.2.0 |
# |193.1.0 |193.2.0 |
# |.2 |.2 |
# gateway1 gateway2 s3:10.0.1
# gateway1 gateway2 s3:193.0.1
# |.1 |.1 |.2 |.3 |.4
# s1:10.1.1 --s2:10.2.1-- m6 m7 m8
# s1:193.1.1 --s2:193.2.1-- m6 m7 m8
# |.2 |.3 |.2 |.3 |.4 |.5 |
# m1 m2 m3 m4 m5 m10 m9
#
......@@ -306,26 +306,26 @@ m9_if_0.up = m10_if_0.up = in_if_4.up = r2_if_0.up = True
# Add IPv4 addresses
re_if_0.add_v4_address(address=REGISTRY, prefix_len=24)
r2_if_0.add_v4_address(address=REGISTRY2, prefix_len=24)
in_if_0.add_v4_address(address='10.0.0.1', prefix_len=24)
in_if_1.add_v4_address(address='10.1.0.1', prefix_len=24)
in_if_2.add_v4_address(address='10.2.0.1', prefix_len=24)
in_if_3.add_v4_address(address='10.0.1.1', prefix_len=24)
in_if_0.add_v4_address(address='193.0.0.1', prefix_len=24)
in_if_1.add_v4_address(address='193.1.0.1', prefix_len=24)
in_if_2.add_v4_address(address='193.2.0.1', prefix_len=24)
in_if_3.add_v4_address(address='193.0.1.1', prefix_len=24)
in_if_3.add_v6_address(address='2001:db8::1', prefix_len=48)
g1_if_0.add_v4_address(address='10.1.0.2', prefix_len=24)
g1_if_1.add_v4_address(address='10.1.1.1', prefix_len=24)
g2_if_0.add_v4_address(address='10.2.0.2', prefix_len=24)
g2_if_1.add_v4_address(address='10.2.1.1', prefix_len=24)
m1_if_0.add_v4_address(address='10.1.1.2', prefix_len=24)
m2_if_0.add_v4_address(address='10.1.1.3', prefix_len=24)
m3_if_0.add_v4_address(address='10.2.1.2', prefix_len=24)
m4_if_0.add_v4_address(address='10.2.1.3', prefix_len=24)
m5_if_0.add_v4_address(address='10.2.1.4', prefix_len=24)
m10_if_0.add_v4_address(address='10.2.1.5', prefix_len=24)
m6_if_0.add_v4_address(address='10.0.1.2', prefix_len=24)
m7_if_0.add_v4_address(address='10.0.1.3', prefix_len=24)
m8_if_0.add_v4_address(address='10.0.1.4', prefix_len=24)
g1_if_0.add_v4_address(address='193.1.0.2', prefix_len=24)
g1_if_1.add_v4_address(address='193.1.1.1', prefix_len=24)
g2_if_0.add_v4_address(address='193.2.0.2', prefix_len=24)
g2_if_1.add_v4_address(address='193.2.1.1', prefix_len=24)
m1_if_0.add_v4_address(address='193.1.1.2', prefix_len=24)
m2_if_0.add_v4_address(address='193.1.1.3', prefix_len=24)
m3_if_0.add_v4_address(address='193.2.1.2', prefix_len=24)
m4_if_0.add_v4_address(address='193.2.1.3', prefix_len=24)
m5_if_0.add_v4_address(address='193.2.1.4', prefix_len=24)
m10_if_0.add_v4_address(address='193.2.1.5', prefix_len=24)
m6_if_0.add_v4_address(address='193.0.1.2', prefix_len=24)
m7_if_0.add_v4_address(address='193.0.1.3', prefix_len=24)
m8_if_0.add_v4_address(address='193.0.1.4', prefix_len=24)
m6_if_1.add_v4_address(address='192.168.241.1', prefix_len=24)
in_if_4.add_v4_address(address='10.3.0.1', prefix_len=24)
in_if_4.add_v4_address(address='193.3.0.1', prefix_len=24)
# Add IPv6 addresses to test UDP6 between m8 and m6/m7
m6_if_0.add_v6_address(address='fc42:6::1', prefix_len=16)
......@@ -344,22 +344,22 @@ add_llrtr(re_if_0, in_if_0)
add_llrtr(r2_if_0, in_if_4)
add_llrtr(in_if_0, re_if_0, '2001:db8:42::/48')
add_llrtr(in_if_4, r2_if_0, '2001:db8:43::/48')
registry.add_route(prefix='10.0.0.0', prefix_len=8, nexthop='10.0.0.1')
registry2.add_route(prefix='10.0.0.0', prefix_len=8, nexthop='10.3.0.1')
internet.add_route(prefix='10.2.0.0', prefix_len=16, nexthop='10.2.0.2')
gateway1.add_route(prefix='10.0.0.0', prefix_len=8, nexthop='10.1.0.1')
gateway2.add_route(prefix='10.0.0.0', prefix_len=8, nexthop='10.2.0.1')
registry.add_route(prefix='193.0.0.0', prefix_len=8, nexthop='193.0.0.1')
registry2.add_route(prefix='193.0.0.0', prefix_len=8, nexthop='193.3.0.1')
internet.add_route(prefix='193.2.0.0', prefix_len=16, nexthop='193.2.0.2')
gateway1.add_route(prefix='193.0.0.0', prefix_len=8, nexthop='193.1.0.1')
gateway2.add_route(prefix='193.0.0.0', prefix_len=8, nexthop='193.2.0.1')
for m in machine1, machine2:
m.add_route(nexthop='10.1.1.1')
m.add_route(nexthop='193.1.1.1')
for m in machine3, machine4, machine5, machine10:
m.add_route(prefix='10.0.0.0', prefix_len=8, nexthop='10.2.1.1')
m.add_route(prefix='193.0.0.0', prefix_len=8, nexthop='193.2.1.1')
for m in machine6, machine7, machine8:
m.add_route(prefix='10.0.0.0', prefix_len=8, nexthop='10.0.1.1')
m.add_route(prefix='193.0.0.0', prefix_len=8, nexthop='193.0.1.1')
# Test connectivity first. Run process, hide output and check
# return code
null = file(os.devnull, "r+")
for ip in '10.1.1.2', '10.1.1.3', '10.2.1.2', '10.2.1.3':
for ip in '193.1.1.2', '193.1.1.3', '193.2.1.2', '193.2.1.3':
if machine1.Popen(('ping', '-c1', ip), stdout=null).wait():
print 'Failed to ping %s' % ip
break
......@@ -451,7 +451,7 @@ def new_network(registry, reg_addr, serial, ca):
with new_network(registry, REGISTRY, REGISTRY_SERIAL, 'ca.crt') as new_node:
new_node(machine1, 'm1', '-I%s' % m1_if_0.name)
new_node(machine2, 'm2', '--remote-gateway 10.1.1.1', prefix_len=80)
new_node(machine2, 'm2', '--remote-gateway 193.1.1.1', prefix_len=80)
new_node(machine3, 'm3', '-i%s' % m3_if_0.name)
new_node(machine4, 'm4', '-i%s' % m4_if_0.name)
new_node(machine5, 'm5', '-i%s' % m5_if_0.name)
......@@ -599,8 +599,8 @@ def node_by_ll(addr):
for a in a:
p = a['prefix_len']
a = a['address']
if a.startswith('10.'):
if a.startswith('10.42.'):
if a.startswith('193.'):
if a.startswith('193.42.'):
assert not p % 8
_ll[socket.inet_ntoa(socket.inet_aton(
a)[:p/8].ljust(4, '\0'))] = n, t
......@@ -619,7 +619,7 @@ def route_svg(ipv4, z = 4, default = type('', (), {'short': None})):
for n in nodes:
g = graph[n] = defaultdict(list)
for r in n.get_routes():
if (r.prefix and r.prefix.startswith('10.42.') if ipv4 else
if (r.prefix and r.prefix.startswith('193.42.') if ipv4 else
r.prefix is None or r.prefix.startswith('2001:db8:')):
try:
g[node_by_ll(r.nexthop)].append(
......
clean_ruleset_interval=600
allow 1024-65535 10.0.0.0/8 1024-65535
allow 1024-65535 193.0.0.0/8 1024-65535
deny 0-65535 0.0.0.0/0 0-65535
......@@ -6,7 +6,7 @@
hello 4
client-count 2
tunnel-refresh 100
ipv4 10.42.0.0/16 8
ipv4 193.42.0.0/16 8
@registry
ca ca.crt
same-country CN
......
......@@ -16,7 +16,7 @@
@m3
pp 1194 tcp
@m4
ip 10.2.1.3
ip 193.2.1.3
pp 1194 tcp
default
@m5
......
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