new-new-net

This commit is contained in:
Ansible Admin 2016-05-17 23:42:37 +02:00
parent 6e11ce3510
commit e085ddd3a5
9 changed files with 26 additions and 32 deletions

View File

@ -4,10 +4,10 @@ option domain-name "fftdf";
default-lease-time 300; default-lease-time 300;
max-lease-time 3600; max-lease-time 3600;
log-facility local7; log-facility local7;
subnet 10.188.0.0 netmask 255.255.0.0 { subnet {{ sn_mesh_IPv4_net }} netmask 255.255.224.0 {
authoritative; authoritative;
range {{ sn_dhcp_range }}; 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 routers {{ sn_mesh_IPv4 }};
option interface-mtu {{ sn_mtu }}; option interface-mtu {{ sn_mtu }};
interface bat0; interface bat0;

View File

@ -6,17 +6,10 @@ authoritative;
default-lease-time 300; default-lease-time 300;
max-lease-time 600; max-lease-time 600;
#option dhcp6.name-servers {{ sn_mesh_IPv6 }}; option dhcp6.name-servers {{ sn_mesh_IPv6 }};
option dhcp6.name-servers {{ sn_mesh_IPv6 }}, {{ sn_dhcp_dns_v6 }};
option dhcp6.domain-search "fftdf"; option dhcp6.domain-search "fftdf";
subnet6 2a03:2260:121::/64 { subnet6 {{ sn_mesh_IPv6_net }} {
#
# # 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;
} }

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# Version 6 # Version 7
# Der servername muss mit einer einstelligen Zahl aufhoeren!!!!! # Der servername muss mit einer einstelligen Zahl aufhoeren!!!!!
communityname="troisdorf" communityname="troisdorf"
server="troisdorf1 troisdorf2 troisdorf3 troisdorf4 troisdorf5 troisdorf6 troisdorf7 troisdorf8 troisdorf9" server="troisdorf1 troisdorf2 troisdorf3 troisdorf4 troisdorf5 troisdorf6 troisdorf7 troisdorf8 troisdorf9"
@ -24,30 +24,31 @@ batctl=/usr/local/sbin/batctl
ip=/sbin/ip ip=/sbin/ip
dig=/usr/bin/dig dig=/usr/bin/dig
for i in $server; do #for i in $server; do
( #(
for j in $server; do # for j in $server; do
if [ $i != $j ]; then # if [ $i != $j ]; then
if [ $i = $localserver ]; 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 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 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 address $communitymacaddress:${i#$communityname}${j#$communityname} dev l2tp-$j
ip link set dev l2tp-$j mtu $mtu # ip link set dev l2tp-$j mtu $mtu
ip link set up l2tp-$j # ip link set up l2tp-$j
$batctl if add l2tp-$j # $batctl if add l2tp-$j
fi # fi
fi # fi
done # done
) #)
done #done
# Rest starten # Rest starten
$ip link set address $communitymacaddress:0${localserver#$communityname} dev bat0 $ip link set address $communitymacaddress:0${localserver#$communityname} dev bat0
$ip link set up dev bat0 $ip link set up dev bat0
$ip addr add $communitynetwork.$octet3rd.${localserver#$communityname}/16 broadcast $communitynetwork.255.255 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 addr add {{ sn_mesh_IPv4 }}/19 broadcast {{ sn_mesh_IPv4_brcast }} dev bat0
$ip route add {{ snx_ffrl_IPv4 }}/32 via {{ snx_mesh_IPv4 }} table 42 #$ip -6 addr add $communitynetworkv6$octet3rd:${localserver#$communityname}/64 dev bat0
$ip route add {{ snx_ffrl_IPv4 }}/32 via {{ snx_mesh_IPv4 }} $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 /usr/bin/killall batadv-vis
/bin/sleep 15 /bin/sleep 15