Reset host networking from the CLI in an emergency
Environment
An XCP-ng host whose management network is misconfigured and unreachable from XO. Run this from the host console: it reconfigures the management interface, so an SSH session over that interface will drop.
Procedure
Static address, no VLAN:
# xe-reset-networking --device=eth0 --mode=static --novlan --ip=10.10.10.10 --netmask=255.255.255.0 --gateway=10.10.10.1 --dns=10.10.10.1
DHCP on a VLAN:
# xe-reset-networking --device=eth0 --mode=dhcp --vlan=100
Useful options:
| Option | Meaning |
|---|---|
-m, --master=ADDRESS | the master's address, for a slave |
--device=DEVICE | device name of the new management interface |
--mode=MODE | none, dhcp or static, default dhcp |
--mode-v6=MODE_V6 | none, dhcp, autoconf or static, default none |
--novlan | no VLAN on the new management interface |
--vlan=VLAN | VLAN id for the new management interface |
--ip, --netmask, --gateway, --dns | static configuration |
Verification
The host reboots as part of the reset. Once it is back, confirm the management interface and that the pool sees it:
# xe pif-list management=true params=IP,device,VLAN # xe host-list params=name-label,enabled
On a slave, pass --master so it rejoins the pool rather than coming back
isolated.
Was this page helpful?