|
|
|
@ -271,20 +271,20 @@ echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Writing network interfaces file..." >> /mnt/setup-chroot.sh
|
|
|
|
echo "Writing network interfaces file..." >> /mnt/setup-chroot.sh
|
|
|
|
macaddr=$(echo $hostname|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
|
|
|
|
macaddr=$(echo $hostname|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
|
|
|
|
echo "mkdir -p /etc/network && mkdir -p /etc/network/interfaces.d" >> /mnt/setup-chroot.sh
|
|
|
|
mkdir -p /mnt/etc/network && mkdir -p /mnt/etc/network/interfaces.d
|
|
|
|
echo "echo \"auto lo br0\" > /etc/network/interfaces" >> /mnt/setup-chroot.sh
|
|
|
|
echo "auto lo br0" > /mnt/etc/network/interfaces.d/br0
|
|
|
|
echo "echo \"iface lo inet loopback\" >> /etc/network/interfaces" >> /mnt/setup-chroot.sh
|
|
|
|
echo "iface lo inet loopback" >> /etc/network/interfaces.d/br0
|
|
|
|
niclist=""
|
|
|
|
niclist=""
|
|
|
|
for nic in "$nics"; do
|
|
|
|
for nic in "$nics"; do
|
|
|
|
echo "echo \"iface ${nic} inet manual\" >> /etc/network/interfaces" >> /mnt/setup-chroot.sh
|
|
|
|
echo "iface ${nic} inet manual" >> /etc/network/interfaces.d/br0
|
|
|
|
niclist="$niclist $nic"
|
|
|
|
niclist="$niclist $nic"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo "echo \"iface br0 inet dhcp\" >> /etc/network/interfaces.d/br0" >> /mnt/setup-chroot.sh
|
|
|
|
echo "iface br0 inet dhcp" >> /mnt/etc/network/interfaces.d/br0
|
|
|
|
echo "echo \" post-up ip link set br0 address $macaddr\" >> /etc/network/interfaces/br0" >> /mnt/setup-chroot.sh
|
|
|
|
echo " post-up ip link set br0 address $macaddr" >> /mnt/etc/network/interfaces/br0
|
|
|
|
echo "echo \" bridge_ports${niclist}\" >> /etc/network/interfaces/br0" >> /mnt/setup-chroot.sh
|
|
|
|
echo " bridge_ports${niclist}" >> /mnt/etc/network/interfaces/br0
|
|
|
|
echo "echo \" bridge_stp on\" >> /etc/network/interfaces/br0" >> /mnt/setup-chroot.sh
|
|
|
|
echo " bridge_stp on" >> /mnt/etc/network/interfaces/br0
|
|
|
|
echo "echo \" dns-nameservers 127.0.0.53\" >> /etc/network/interfaces/br0" >> /mnt/setup-chroot.sh
|
|
|
|
echo " dns-nameservers 127.0.0.53" >> /mnt/etc/network/interfaces/br0
|
|
|
|
echo "echo \"source-directory /etc/network/interfaces.d\" > /etc/network/interfaces" >> /mnt/setup-chroot.sh
|
|
|
|
echo "source-directory /etc/network/interfaces.d" > /mnt/etc/network/interfaces
|
|
|
|
echo "systemctl unmask networking && systemctl enable networking" >> /mnt/setup-chroot.sh
|
|
|
|
echo "systemctl unmask networking && systemctl enable networking" >> /mnt/setup-chroot.sh
|
|
|
|
echo "Done." >> /mnt/setup-chroot.sh
|
|
|
|
echo "Done." >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
|