ESX Console
- logon to the console screen of the ESXi 5.1 Server
- press F2 to customize system
- enter login name as root
- enter your root password
- On the System Customization screen select "Troubleshooting Option"
- Enable ESXi shell
- If you wnat to execute remotely then Enable SSH
- press ESC 2 times to return to the Main Screen
- press ALT F1 to goto the console screen
- login as root with password, then you will see the command prompt "~ #"
On the command line, list the network adapters like below for checking;
~ # esxcli network nic list
Name PCI Device Driver Link Speed Duplex MAC Address MTU Description
------ ------------- ------ ---- ----- ------ ----------------- ---- --------------------------------------------------------
vmnic0 0000:003:00.0 tg3 Up 1000 Full 00:23:7d:df:9d:3a 1500 Broadcom Corporation NetXtreme BCM5715S Gigabit Ethernet
vmnic1 0000:003:00.1 tg3 Up 1000 Full 00:23:7d:df:9d:3e 1500 Broadcom Corporation NetXtreme BCM5715S Gigabit Ethernet
First change vmnic1, (DON't change vmnic0 because this is your current connection if using remote ssh)
To change vmnic1 settings, please use below syntax;
Usage: esxcli network ip interface ipv4 set [cmd options]
Description:
set Configure IPv4 setting for a given VMkernel network interface.
Cmd options:
-i|--interface-name=<str>
The name of the VMkernel network interface to set IPv4 settings for. This name must be an interface listed in the interface list command. (required)
-I|--ipv4=<str>
The static IPv4 address for this interface.
-N|--netmask=<str>
The static IPv4 netmask for this interface.
-P|--peer-dns
A boolean value to indicate if the system should use the DNS settings published via DHCP for this interface.
-t|--type=<str>
IPv4 Address type : dhcp: Use DHCP to aquire IPv4 setting for this interface. none: Remove IPv4 settings form this interface. static: Set Static IPv4 information for this interface. Requires --ipv4 and --netmask options. required)
for example to change the adapter vmk1 settings to use static IPV4, IP address and netmask is 172.17.23.35 255.255.255.0
use below command;
~ # esxcli network ip interface ipv4 set -i vmk1 -I 172.17.23.35 -N 255.255.255.0 -t static
then list the gateway for checking;
~ # esxcli network ip route list
next, change the gateway;
~ # esxcli network ip route ipv4 add -g 172.17.23.1 -n default
when you are ready to change the first adapter vmk0, use the same command syntax;
for example IP address and netmask is 172.17.23.25 255.255.255.0
~ # esxcli network ip interface ipv4 set -i vmk0 -I 172.17.23.25 -N 255.255.255.0 -t static
again, change the gateway;
~ # esxcli network ip route ipv4 add -g 172.17.23.1 -n default
Test by pinging the 2 IP addresses above from another machine to see if both vmk0 and vmk1 are responding correctly.
Last thing to do, remember to update your internal DNS to point to the right IP address of the ESXi server.
Also go back to the console screen of the ESX server, exit the shell and disable ESXi shell.
I came here for CLI syntax to check default gateway (route) for VMK0, and was happy to see:
ReplyDelete# esxcli network ip route list
but it doesn' work on my ESXi5 (5.0). I get
"unknown command or namespace network ip route list" Am I missing something?
thanks for the great info!
I worked this out on ESXi 5.1u1 as:
Delete# esxcli network ip route ipv4 list
Maybe this command is different between ESXi5.0 and 5.1. On my ESXi5.0 Update 1 I could run:
ReplyDelete#esxcfg-route -l