From e085ddd3a515494c3771c0862b40e82cf4a7d733 Mon Sep 17 00:00:00 2001 From: Ansible Admin Date: Tue, 17 May 2016 23:42:37 +0200 Subject: [PATCH] new-new-net --- ...d-troisdorf1.conf => bird-troisdorf4.conf} | 0 ...d-troisdorf2.conf => bird-troisdorf7.conf} | 0 ...-troisdorf1.conf => bird6-troisdorf4.conf} | 0 ...-troisdorf2.conf => bird6-troisdorf7.conf} | 0 files/dhcpd.conf.j2 | 4 +- files/dhcpd6.conf.j2 | 11 +---- ...faces-troisdorf1 => interfaces-troisdorf4} | 0 ...faces-troisdorf2 => interfaces-troisdorf7} | 0 files/l2tp_backbone.sh.exit.j2 | 43 ++++++++++--------- 9 files changed, 26 insertions(+), 32 deletions(-) rename files/{bird-troisdorf1.conf => bird-troisdorf4.conf} (100%) rename files/{bird-troisdorf2.conf => bird-troisdorf7.conf} (100%) rename files/{bird6-troisdorf1.conf => bird6-troisdorf4.conf} (100%) rename files/{bird6-troisdorf2.conf => bird6-troisdorf7.conf} (100%) rename files/{interfaces-troisdorf1 => interfaces-troisdorf4} (100%) rename files/{interfaces-troisdorf2 => interfaces-troisdorf7} (100%) diff --git a/files/bird-troisdorf1.conf b/files/bird-troisdorf4.conf similarity index 100% rename from files/bird-troisdorf1.conf rename to files/bird-troisdorf4.conf diff --git a/files/bird-troisdorf2.conf b/files/bird-troisdorf7.conf similarity index 100% rename from files/bird-troisdorf2.conf rename to files/bird-troisdorf7.conf diff --git a/files/bird6-troisdorf1.conf b/files/bird6-troisdorf4.conf similarity index 100% rename from files/bird6-troisdorf1.conf rename to files/bird6-troisdorf4.conf diff --git a/files/bird6-troisdorf2.conf b/files/bird6-troisdorf7.conf similarity index 100% rename from files/bird6-troisdorf2.conf rename to files/bird6-troisdorf7.conf diff --git a/files/dhcpd.conf.j2 b/files/dhcpd.conf.j2 index e226e31..8cd5205 100644 --- a/files/dhcpd.conf.j2 +++ b/files/dhcpd.conf.j2 @@ -4,10 +4,10 @@ option domain-name "fftdf"; default-lease-time 300; max-lease-time 3600; log-facility local7; -subnet 10.188.0.0 netmask 255.255.0.0 { +subnet {{ sn_mesh_IPv4_net }} netmask 255.255.224.0 { authoritative; range {{ sn_dhcp_range }}; -option domain-name-servers {{ sn_mesh_IPv4 }}, {{ sn_dhcp_dns_v4 }}; +option domain-name-servers {{ sn_mesh_IPv4 }}; option routers {{ sn_mesh_IPv4 }}; option interface-mtu {{ sn_mtu }}; interface bat0; diff --git a/files/dhcpd6.conf.j2 b/files/dhcpd6.conf.j2 index e16eb8b..2a79b20 100644 --- a/files/dhcpd6.conf.j2 +++ b/files/dhcpd6.conf.j2 @@ -6,17 +6,10 @@ authoritative; default-lease-time 300; max-lease-time 600; -#option dhcp6.name-servers {{ sn_mesh_IPv6 }}; -option dhcp6.name-servers {{ sn_mesh_IPv6 }}, {{ sn_dhcp_dns_v6 }}; +option dhcp6.name-servers {{ sn_mesh_IPv6 }}; option dhcp6.domain-search "fftdf"; -subnet6 2a03:2260:121::/64 { -# -# # Range for clients -# range6 2a03:2260:121::201 2a03:2260:121::ffff; -# -# # Range for clients requesting a temporary address -# range6 2a03:2260:121::/64 temporary; +subnet6 {{ sn_mesh_IPv6_net }} { } diff --git a/files/interfaces-troisdorf1 b/files/interfaces-troisdorf4 similarity index 100% rename from files/interfaces-troisdorf1 rename to files/interfaces-troisdorf4 diff --git a/files/interfaces-troisdorf2 b/files/interfaces-troisdorf7 similarity index 100% rename from files/interfaces-troisdorf2 rename to files/interfaces-troisdorf7 diff --git a/files/l2tp_backbone.sh.exit.j2 b/files/l2tp_backbone.sh.exit.j2 index 28e4b2a..58da4c1 100644 --- a/files/l2tp_backbone.sh.exit.j2 +++ b/files/l2tp_backbone.sh.exit.j2 @@ -1,5 +1,5 @@ #!/bin/sh -# Version 6 +# Version 7 # Der servername muss mit einer einstelligen Zahl aufhoeren!!!!! communityname="troisdorf" server="troisdorf1 troisdorf2 troisdorf3 troisdorf4 troisdorf5 troisdorf6 troisdorf7 troisdorf8 troisdorf9" @@ -24,30 +24,31 @@ batctl=/usr/local/sbin/batctl ip=/sbin/ip dig=/usr/bin/dig -for i in $server; do -( - for j in $server; do - if [ $i != $j ]; then - if [ $i = $localserver ]; then - ip l2tp add tunnel remote $($dig +short $j.$domain) local $(/bin/hostname -I | /usr/bin/cut -f1 -d' ') tunnel_id $tunnelPrefix${i#$communityname}${j#$communityname} peer_tunnel_id $tunnelPrefix${j#$communityname}${i#$communityname} encap udp udp_sport 300${i#$communityname}${j#$communityname} udp_dport 300${j#$communityname}${i#$communityname} - ip l2tp add session name l2tp-$j tunnel_id $tunnelPrefix${i#$communityname}${j#$communityname} session_id $sessionPrefix${i#$communityname}${j#$communityname} peer_session_id $sessionPrefix${j#$communityname}${i#$communityname} - #ip link set address $communitymacaddress:${i#$communityname}${j#$communityname} dev l2tp-$j - ip link set dev l2tp-$j mtu $mtu - ip link set up l2tp-$j - $batctl if add l2tp-$j - fi - fi - done -) -done +#for i in $server; do +#( +# for j in $server; do +# if [ $i != $j ]; then +# if [ $i = $localserver ]; then +# ip l2tp add tunnel remote $($dig +short $j.$domain) local $(/bin/hostname -I | /usr/bin/cut -f1 -d' ') tunnel_id $tunnelPrefix${i#$communityname}${j#$communityname} peer_tunnel_id $tunnelPrefix${j#$communityname}${i#$communityname} encap udp udp_sport 300${i#$communityname}${j#$communityname} udp_dport 300${j#$communityname}${i#$communityname} +# ip l2tp add session name l2tp-$j tunnel_id $tunnelPrefix${i#$communityname}${j#$communityname} session_id $sessionPrefix${i#$communityname}${j#$communityname} peer_session_id $sessionPrefix${j#$communityname}${i#$communityname} +# #ip link set address $communitymacaddress:${i#$communityname}${j#$communityname} dev l2tp-$j +# ip link set dev l2tp-$j mtu $mtu +# ip link set up l2tp-$j +# $batctl if add l2tp-$j +# fi +# fi +# done +#) +#done # Rest starten $ip link set address $communitymacaddress:0${localserver#$communityname} dev bat0 $ip link set up dev bat0 -$ip addr add $communitynetwork.$octet3rd.${localserver#$communityname}/16 broadcast $communitynetwork.255.255 dev bat0 -$ip -6 addr add $communitynetworkv6$octet3rd:${localserver#$communityname}/64 dev bat0 -$ip route add {{ snx_ffrl_IPv4 }}/32 via {{ snx_mesh_IPv4 }} table 42 -$ip route add {{ snx_ffrl_IPv4 }}/32 via {{ snx_mesh_IPv4 }} +#$ip addr add $communitynetwork.$octet3rd.${localserver#$communityname}/16 broadcast $communitynetwork.255.255 dev bat0 +$ip addr add {{ sn_mesh_IPv4 }}/19 broadcast {{ sn_mesh_IPv4_brcast }} dev bat0 +#$ip -6 addr add $communitynetworkv6$octet3rd:${localserver#$communityname}/64 dev bat0 +$ip -6 addr add {{ sn_mesh_IPv6 }}/64 dev bat0 +$ip route add 10.188.0.0/16 via 10.188.x.254 table 42 /usr/bin/killall batadv-vis /bin/sleep 15