diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-06-13 22:28:39 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-06-13 22:28:39 -0300 |
commit | cd2f289ea85183786601c1eef6ff7e1cc2f9a8e2 (patch) | |
tree | fb348cf412343f074d8772fab39be9e3b502f5e5 | |
parent | af3c00d3caea9ef7939953b7d3d8b4a1dcbd7863 (diff) | |
download | kvmx-cd2f289ea85183786601c1eef6ff7e1cc2f9a8e2.tar.gz kvmx-cd2f289ea85183786601c1eef6ff7e1cc2f9a8e2.tar.bz2 |
Networking cleanup at kvmx-create
-rwxr-xr-x | kvmx-create | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/kvmx-create b/kvmx-create index 907b531..76f2eb4 100755 --- a/kvmx-create +++ b/kvmx-create @@ -115,12 +115,12 @@ function kvmx_config { kvmx_user_config user user "Initial user name" kvmx_user_config password $default_password "Initial user password" kvmx_user_config net user "Networking config (user or tap)" + kvmx_user_config net_dns 192.168.1.1 "DNS" if [ "$net" == "tap" ]; then kvmx_user_config net_ip 10.1.1.2 "IP address" kvmx_user_config net_mask 255.255.0 "Netmask" kvmx_user_config net_gateway 10.1.1.1 "Gateway" - kvmx_user_config net_dns 192.168.1.1 "DNS" fi if [ ! -z "$image_base" ]; then @@ -391,39 +391,28 @@ EOF # Second stage procedure function __kvmx_create_custom_second_stage { if [ ! -z "$net_ip" ] && [ ! -z "$net_mask" ] && [ ! -z "$net_gateway" ]; then - # Networking: eth0 - cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces.d/eth0 > /dev/null -auto eth0 -iface eth0 inet static - address $net_ip - netmask $net_mask - gateway $net_gateway -EOF - - # Networking: ens3 + # Networking # See #799253 - virtio ens3 network interface # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=799253 - cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces.d/ens3 > /dev/null -auto ens3 -iface ens3 inet static + for net_dev in eth0 ens3 ens4; do + cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces.d/eth0 > /dev/null +auto $net_dev +iface $net_dev inet static address $net_ip netmask $net_mask gateway $net_gateway EOF + done else - # Networking: eth0 - cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces.d/eth0 > /dev/null -allow-hotplug eth0 -iface eth0 inet dhcp -EOF - - # Networking: ens3 + # Networking # See #799253 - virtio ens3 network interface # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=799253 - cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces.d/ens3 > /dev/null -allow-hotplug ens3 -iface ens3 inet dhcp + for net_dev in eth0 ens3 ens4; do + cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces.d/eth0 > /dev/null +allow-hotplug $net_dev +iface $net_dev inet dhcp EOF + done fi # DNS config |