[XEN-IP CHANGE] Numerous bugs in IP change script

Editing a Xen VM inside Cloudmin and setting a new IP, new Gateway, new CIDR/Netmask, is very broken.

The edit method I use is to shut down the VM, going into their System Configuration: Network Interfaces and set them to their appropriate IPs, netmask and gateway.

Afterwards:

  • The per-VM Xen *.cfg files still have the old Netmask.
  • The server index files under /etc/webmin/servers/.serv files contain "xen_" values that specify the xen settings used for the system. They never get updated during the network interface editing above.
  • The resolv.conf gateway/DNS is not updated and has to be fixed manually or the VM will try to reach the old DNS server at the old gateway/DNS location.
  • Worst of all, /etc/sysconfig/network-scripts/ifcfg-eth0 inside the VM contains the old BROADCAST address, meaning that broadcast packets are misrouted.

Also, attempting to edit the latter (ifcfg-eth0) via the Virtualmin Network Interface Editor puts lots of junk in the config:

NAME=""
BOOTPROTO=none
GATEWAY=10.0.0.1
MACADDR=""
IPV6INIT=no
TYPE=Ethernet
DEVICE=eth0
MTU=""
NETMASK=255.255.254.0
BROADCAST=10.0.1.255
IPADDR=10.0.1.2
NETWORK=10.0.0.0
ONBOOT=yes

It inserts things like the empty MTU, empty MACADDR, etc. Those were not in the config before using the virtualmin network interfaces module. That module is therefore useless at the moment.

Status: 
Closed (fixed)

Comments

Thanks for the bug report..

  1. I'll fix the setting of the netmask in the next release.

  2. Those xen_ lines with the IP don't really matter - they are only used when the VM is created.

  3. Cloudmin doesn't manage resolv.conf at all, nor does it assume that it will always be the same as the gateway.

  4. I'll make sure that the broadcast is set / modified correctly in the next release..

Automatically closed -- issue fixed for 2 weeks with no activity.