X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FFSF%2F11-iank;fp=fai%2Fconfig%2Fscripts%2FFSF%2F11-iank;h=8a33d6f70edd1c614089bcdb88844d755d8d01d7;hp=93c227f584d7b3854aad7a3035e545d17cd85bd8;hb=137ffae7de84a51c4b438ccf2fb50f5571f522a6;hpb=14f283f82afc48d6cec1bb7498ec34ac2b0da77c diff --git a/fai/config/scripts/FSF/11-iank b/fai/config/scripts/FSF/11-iank index 93c227f..8a33d6f 100755 --- a/fai/config/scripts/FSF/11-iank +++ b/fai/config/scripts/FSF/11-iank @@ -23,27 +23,78 @@ iface eth0 inet6 auto source-directory /etc/network/interfaces.d EOF else - ip=$(getent ahosts $HOSTNAME |grep ^209.*RAW| sed 's/ .*//') - ip6=$(getent ahosts $HOSTNAME |grep ^2001.*RAW| sed 's/ .*//') - gateway=209.51.188.1 + ip6=$(getent ahosts $HOSTNAME |grep ^2001.*RAW| sed 's/ .*//' ||:) gateway6=2001:470:142::1 - cat > $target/etc/network/interfaces </dev/null; then + cat >$target/etc/network/interfaces < /proc/sys/net/ipv6/conf/eth0/accept_dad +auto eth1 +allow-bond eth1 +iface eth1 inet manual + bond-master bond0 + +auto bond0 +iface bond0 inet static + bond-slaves none + bond-mode 0 + bond-miimon 100 + address $internal_ip + pre-up ip link add link bond0 name macvtap-bond0 type macvtap mode bridge +# no iptables files exist yet +# post-up iptables-restore < /etc/default/iptables ; ip6tables-restore < /etc/default/ip6tables || : + +auto macvtap-bond0 +iface macvtap-bond0 inet static + address $CIDR + gateway $GATEWAYS + post-up ip a add $internal_ip broadcast 10.0.255.255 dev macvtap-bond0 + +EOF + + # I'm not sure ipv6 works well with the macvtap stuff. todo: research. + # anyways, other kvm hosts dont have it enabled. + if false && [[ $ip6 ]]; then + cat >>$target/etc/network/interfaces < /proc/sys/net/ipv6/conf/bond0/accept_dad address $ip6 netmask 48 gateway $gateway6 EOF + fi + + else + cat > $target/etc/network/interfaces <>$target/etc/network/interfaces < /proc/sys/net/ipv6/conf/eth0/accept_dad +address $ip6 +netmask 48 +gateway $gateway6 +EOF + fi + fi fi # previously had an else condition after @@ -61,10 +112,13 @@ fi ##### end network setup ##### +# note: systemd-resolved + ifupdown causes networking.service to fail in t11, +# https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1907878 +systemctl disable systemd-resolved # rm first to remove any symlink rm -f $target/etc/resolv.conf -if ifclass demohost; then +if ifclass demohost || [[ $GATEWAYS != 209.51.188.* ]]; then cat >$target/etc/resolv.conf <<'EOF' nameserver 8.8.8.8 EOF