getting very very close

This commit is contained in:
root 2018-07-28 18:47:08 +00:00
parent 14c4cd626b
commit 27ece3ddea
6 changed files with 20 additions and 12 deletions

2
debian/control vendored
View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.2
Package: wit-hypervisor
Architecture: all
Depends: ${misc:Depends}, frr (>= 4.0-wit), sed, tcpdump, mtr-tiny, iproute2, ifupdown, ipmitool, iptables, lldpd, strongswan, telnet, netcat, fping, curl, wget, ifstat, rsyslog, ncurses-term, net-tools, bridge-utils, vlan
Depends: ${misc:Depends}, frr (>= 4.0-wit), sed, tcpdump, mtr-tiny, iproute2, ifupdown, ipmitool, iptables, lldpd, strongswan, telnet, netcat, fping, curl, wget, ifstat, rsyslog, ncurses-term, net-tools, bridge-utils, vlan, gnupg
Provides: ${diverted-files}
Conflicts: ${diverted-files}
Description: Installs basic network packages and

View File

@ -4,6 +4,7 @@ files/vrf-dhcp-exit etc/dhcp/dhclient-exit-hooks.d
files/dhcp-sethostname etc/dhcp/dhclient-exit-hooks.d
files/rc.local etc
files/10-frr.conf etc/sysctl.d
files/11-mgmt1.conf etc/sysctl.d
files/wit-gc usr/bin
files/resolv.conf etc
files/bashrc-witaddon etc

View File

@ -21,7 +21,6 @@ set -e
case "$1" in
configure)
[ -z $NODE_ID ] && export NODE_ID=$(ip -4 -br addr | grep 10.0. | awk '{ print $3 }' | awk 'BEGIN{FS="[./]"} { print $4 }')
export MGMT_ID=$(ip -4 -br addr | grep 10.0. | awk '{ print $3 }' | awk 'BEGIN{FS="[./]"} { print $3 }')
@ -51,24 +50,34 @@ case "$1" in
exit 2
fi
export NODE_ASN="$(printf "%03d" $TIER_ID)$(printf "%03d" $NODE_ID)"
export NODE_ASN="4200$(printf "%03d" $TIER_ID)$(printf "%03d" $NODE_ID)"
export LOOPBACKv4="10.1.$TIER_ID.$NODE_ID"
export LOOPBACKv6="2604:bbc0::$TIER_ID:$NODE_ID"
echo "auto lo:0" >/etc/network/interfaces.d/lo
echo "iface lo:0 inet static\n address 10.1.$TIER_ID.$NODE_ID/32" >> /etc/network/interfaces.d/lo
echo "iface lo:0 inet6 static\n address 2604:bbc0::$TIER_ID:$NODE_ID/128" >> /etc/network/interfaces.d/lo
echo "iface lo:0 inet static" >> /etc/network/interfaces.d/lo
echo " address ${LOOPBACKv4}/32" >> /etc/network/interfaces.d/lo
echo "iface lo:0 inet6 static" >> /etc/network/interfaces.d/lo
echo " address ${LOOPBACKv6}/128" >> /etc/network/interfaces.d/lo
sed -i -e "s/VTEPINDEX/$NODE_ID/" -e "s/TIERID/$TIER_ID/" -e "s/NODEASN/$NODE_ASN/" /etc/frr/frr.conf.wit
sed -i -e "s/FRRROUTERID/${LOOPBACKv4}/" -e "s/NODEASN/${NODE_ASN}/" /etc/frr/frr.conf.wit
chown frr.frr /etc/frr/frr.conf.wit /etc/frr/daemons.wit
sed -i -e "/.*debcore1/d" -e "/.*${HOSTNAME}/d" -e "$ s/$/\n${LOOPBACKv4} ${HOSTNAME}${DOMAINNAME} ${HOSTNAME}/" /etc/hosts
sed -i -e "s/HOSTNAME\.DOMAINNAME/${HOSTNAME}${DOMAINNAME}/" /etc/ipsec.conf.wit
echo ": RSA ${HOSTNAME}${DOMAINNAME}.key" >/etc/ipsec.secrets
chmod 600 /etc/ipsec.secrets
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'$MGMT_MAC'", ATTR{type}=="1", NAME="mgmt1"' >/etc/udev/rules.d/70-persistent-net.rules
i=0
for nic in $(ip -br link | awk '{ print $1 }'); do

View File

@ -48,7 +48,3 @@ net.ipv4.fib_multipath_use_neigh=1
# Allows Apps to Work with VRF
net.ipv4.tcp_l3mdev_accept=1
# disable forwarding for mgmt interface
net.ipv6.conf.mgmt1.forwarding = 0

2
files/11-mgmt1.conf Normal file
View File

@ -0,0 +1,2 @@
# disable forwarding for mgmt interface
net.ipv6.conf.mgmt1.forwarding = 0

View File

@ -13,8 +13,8 @@ interface feth2
ipv6 nd ra-interval 10
no ipv6 nd suppress-ra
!
router bgp 4200NODEASN
bgp router-id 10.1.TIERID.VTEPINDEX
router bgp NODEASN
bgp router-id FRRROUTERID
no bgp default ipv4-unicast
coalesce-time 1000
bgp bestpath as-path multipath-relax