CentOS 7 and VMWare ESXi Networking via CLI
- August
- 30
12:28 pm Uncategorized
Easiest way to get your network up and running correctly and quickly:
1. Make sure you configure your network with static IP address (if needed) when installing. Enter the IP address, network, gateway, etc.
2. Let VMWare assign the MAC. Much easier than trying to manage it through udev or the config files.
Your network configuration file is in /etc/sysconfig/network-scripts/ directory. You only need to touch the file for the specific adapter that is created (e.g. ifcfg-ens192).
If you add another adapter to the machine in VMWare use the following steps:
1. I usually reboot to make sure it is properly detected by the OS.
2. Do an ifconfig -a to see the new adapter name.
3. Copy the ifcfg-ensnnn file to the new name, then edit the contents. Go over each item carefully. Make sure you change the DEVICE line to the new name. Change the UUID line. To get the UUID you can:
nmcli -t --fields uuid,device con show
4. Reboot to make sure it all works, your adapter should be up and have the right IP address, etc. Use ifconfig -a to check it.
To add a static route:
Create a file in /etc/sysconfig/network-scripts called route-ens192 (or whatever the adapter is).
Put the route parameters in there like this:
10.0.0.0/8 via 10.182.3.1 dev ens192
Reboot, then check netstat -nr to make sure you see the proper kernel route.
« Moving a CentOS 7 VM from VMWare to Xenserver | Zwift Group Rides » |
1 comment
Good stuff, thanks George. Going thru this at home now.