Commit f1dd7a55 by Oliver Pinter

comment out the unneeded static routes

parent 12f99067
...@@ -44,8 +44,8 @@ def change_ip_freebsd(interfaces, dns): ...@@ -44,8 +44,8 @@ def change_ip_freebsd(interfaces, dns):
if_file = rcconf_dir + "ifconfig_" + device if_file = rcconf_dir + "ifconfig_" + device
with open(if_file, 'w') as f: with open(if_file, 'w') as f:
ipv4_alias_counter = ipv6_alias_counter = 0 ipv4_alias_counter = ipv6_alias_counter = 0
route6 = "ipv6_static_routes=\"" #route6 = "ipv6_static_routes=\""
route4 = "static_routes=\"" #route4 = "static_routes=\""
for i in conf['addresses']: for i in conf['addresses']:
alias="" alias=""
ip_with_prefix = IPNetwork(i) ip_with_prefix = IPNetwork(i)
...@@ -58,9 +58,9 @@ def change_ip_freebsd(interfaces, dns): ...@@ -58,9 +58,9 @@ def change_ip_freebsd(interfaces, dns):
ipv6_alias_counter += 1 ipv6_alias_counter += 1
f.write("ifconfig_" + device + alias + "=" + f.write("ifconfig_" + device + alias + "=" +
"\"inet6 %(ip)s prefixlen %(pref)s\"\n" % { 'ip' : ip, 'pref' : prefixlen }) "\"inet6 %(ip)s prefixlen %(pref)s\"\n" % { 'ip' : ip, 'pref' : prefixlen })
route6_name=device+"R"+str(ipv6_alias_counter)+"v6" #route6_name=device+"R"+str(ipv6_alias_counter)+"v6"
route6 += route6_name+":"+device+" " #route6 += route6_name+":"+device+" "
f.write("route_"+route6_name+"=\"-net %(netw)s0 -gateway %(gw)s\"\n" % { 'netw' : ip_with_prefix.network, 'gw' : conf['gw6']}) #f.write("route_"+route6_name+"=\"-net %(netw)s -gateway %(gw)s\"\n" % { 'netw' : ip_with_prefix.network, 'gw' : conf['gw6']})
f.write("ipv6_defaultrouter=\""+str(conf['gw6'])+"\"\n") f.write("ipv6_defaultrouter=\""+str(conf['gw6'])+"\"\n")
else: else:
if ipv4_alias_counter > 0: if ipv4_alias_counter > 0:
...@@ -69,14 +69,14 @@ def change_ip_freebsd(interfaces, dns): ...@@ -69,14 +69,14 @@ def change_ip_freebsd(interfaces, dns):
alias = '_alias%d' % (ipv4_alias_counter) alias = '_alias%d' % (ipv4_alias_counter)
ipv4_alias_counter += 1 ipv4_alias_counter += 1
f.write("ifconfig_" + device + alias + "=" + "\"inet %(ip)s/%(pref)s\"\n" % { 'ip' : ip, 'pref' : prefixlen }) f.write("ifconfig_" + device + alias + "=" + "\"inet %(ip)s/%(pref)s\"\n" % { 'ip' : ip, 'pref' : prefixlen })
route4_name=device+"R"+str(ipv4_alias_counter)+"v4" #route4_name=device+"R"+str(ipv4_alias_counter)+"v4"
route4 += route4_name+":"+device+" " #route4 += route4_name+":"+device+" "
f.write("route_"+route4_name+"=\"-net %(netw)s -gateway %(gw)s\"\n" % { 'netw' : ip_with_prefix.network, 'gw' : conf['gw4']}) #f.write("route_"+route4_name+"=\"-net %(netw)s -gateway %(gw)s\"\n" % { 'netw' : ip_with_prefix.network, 'gw' : conf['gw4']})
f.write("defaultrouter=\""+str(conf['gw4'])+"\"\n") f.write("defaultrouter=\""+str(conf['gw4'])+"\"\n")
route4 += "\"\n" #route4 += "\"\n"
route6 += "\"\n" #route6 += "\"\n"
f.write(route4) #f.write(route4)
f.write(route6) #f.write(route6)
with open("/etc/resolv.conf", "w") as f: with open("/etc/resolv.conf", "w") as f:
f.write("nameserver "+dns) f.write("nameserver "+dns)
......
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 sign in to comment