VMware esx Common commands and IP address modifications

Source: Internet
Author: User
Tags ssh port

VMware esx Common commands and IP address modifications

A. VMware ESX Command

1. See your ESX version

Vmware–v

2. View display ESX hardware, kernel, storage, network and other information

Esxcfg-info-a (Show all relevant information)

ESXCFG-INFO-W (displays hardware information on ESX)

3. List services known to ESX

Esxcfg-firewall–s

4. View the specific service situation

Esxcfg-firewall-q sshclinet

5. Restart VMware Services

Service Mgmt-vmware Restart

6. Change the root password

passwd Root

7. Set Kernel advanced options

esxcfg-advcfg-d (Restore the system kernel to its default value)

8. Managing Resource Groups

Esxcfg-resgrp-l (Show all resource groups)

9. List your current virtual switches

Esxcfg-vswitch-l

Esxcfg-vswitch-v 10-p "Service Console" VSwitch0 (the service console on the vSwitch0 is partitioned on VLAN 10, VLAN is not set if VLAN number is 0)

10. View the settings of the console

Esxcfg-vswif-l (List of added network cards)

Esxcfg-vswif-a (add NIC)

11. List the network card of the system

Esxcfg-nics–l

12. Add a virtual switch named (internal) connected to two physical network cards (restart the service, vi can see)

Esxcfg-vswitch-a VSwitch1

Esxcfg-vswitch-a Internal VSwitch1

Esxcfg-vswitch-l Vmnic1 VSwitch1

Esxcfg-vswitch-l Vmnic2 VSwitch1

13. Delete the switch, (note, do not remove the console switch)

Esxcfg-vswitch-d VSwitch1

14. Remove the NIC on the switch

Esxcfg-vswitch-u Vmnic1 VSWITCH2

15. Delete PortGroup

esxcfg-vswitch-d Internel Vswitch1

16. Create Vmkernel switch, if you want to use these features of VMOTION,ISCSI, you must create (usually do not need to add a gateway)

Esxcfg-vswitch-l

Esxcfg-vswitch-a VSWITCH2

Esxcfg-vswitch-a "VM kernel" VSWITCH2

Esxcfg-vswitch-l vmnic3 VSWITCH2

Esxcfg-vmknic-a "VM Kernel"-I 172.16.1.141-n 255.255.252.0 (add a Vmkernel)

17. Firewall settings

ESXCFG-FIREWALL-E sshclient (open firewall SSH port)

Esxcfg-firewall-d sshclient (Close firewall ssh port)

ESXCFG-FIREWALL-E Veritasnetbackup (Veritas NetBackup Service allowed)

Esxcfg-firewall-o 123,UDP,OUT,NTP (123 port output in UDP protocol open for NTP service)

18. Routing Management

Esxcfg-route (routing management for VM Generation network cards)

Esxcfg-route (Show routing table)

Esxcfg-route 172.16.0.254 (set Vmkernel Gateway)

19. Create a console

Esxcfg-vswitch-a VSwitch0

Esxcfg-vswitch-a "Service Console" VSwitch0

Esxcfg-vswitch-l vmnic0 VSwitch0

Esxcfg-vswif-a vswif0-p "Service Console"-I 172.16.1.140-n 255.255.252.0

20. Add a NAS device (a tag,-O, is the name of the NAS server or ip,-s is the shared name of the NAS input)

Esxcfg-nas-a Isos-o nas.vmwar.cn-s ISOs

NAS Connection Management

Esxcfg-nas-r (forcing ESX to connect to NAS server)

Esxcfg-nas-l (use Esxcfg-nas-l to see the results)

Esxcfg-nas-a (add NAS file system to/vmfs directory)

esxcfg-nas-d (delete nas file system)

22. Scan LUN information on SCSI devices

Esxcfg-rescan <vmkernel SCSI Adapter name>

23. Connecting iSCSI devices (e:enable Q: Query D, disable S: Forced search)

Esxcfg-swiscsi-e

24. Set Targetip

Vmkiscsi-tool-d-a 172.16.1.133 vmhba40

25. List the connection to target

Vmkiscsi-tool-l-T Vmhba40

26. List the current disk

Ls-l/vmfs/devices/disks

27. Kernel Dump management tool

Esxcfg-dumppart-l (show current dump partition configuration information)

28. Path Management

Esxcfg-mpath-l (Show all Paths)

Esxcfg-mpath-a (Show all HBA cards)

ESX Authorization Management configuration

Esxcfg-auth

Esxcfg-auth--enablenis (running NIS authentication)

30. Manage Startup devices

Esxcfg-boot

Esxcfg-boot-b (update boot device)

31. Perform INITRD initialization settings

Esxcfg-init

Esxcfg-init (Initialize device)

Esxcfg-linuxnet (in Linux debug mode, the conversion vswif device is named as the ETH naming rule that comes with Linux)

Esxcfg-linuxnet--setup

33. Upgrade

Esxcfg-upgrade (esx2.x upgrade to esx3.x)

two. to change the service Console IP by using a command

Change the IP address of the service console under the CLI, note the case, VMware is the physical NIC virtual into Vmnic, vmnic on the creation of Virtual Switch vswitch, is the network card as a switch to use, not the network card IP address settings, Can only be created on Vswitch interface is vswif, IP settings for vswif

1. Create a service Console using the CLI

[Email protected] root]# esxcfg-vswitch-a vSwitch0 #创建vSwitch0

[[email protected] root]# esxcfg-vswitch-a "Service Console" VSwitch0 #在vSwitch0上创建Portgroup, named Service console

[Email protected] root]# esxcfg-vswitch-l vmnic0 vSwitch0 #将vmnic0绑定在vSwitch0

[[email protected] root]# esxcfg-vswitch–l #可以看到service console is already bound vmnic0

Switch Name Num Ports used Ports configured Ports MTU uplinks

VSwitch0 5 Vmnic0

PortGroup Name VLAN ID used Ports uplinks

Service Console 0 1 vmnic0

[Email protected] root]# esxcfg-vswif-a vswif0-p "Service Console"-I 192.168.1.1-n 255.255.255.0

#创建vswif0并与service console bindings, the IP address in ESX can only be tied to VSWIF0, which is the interface of the virtual switch

[[email protected] root]# esxcfg-vswif–l #可以看到Service console IP has been configured to VSWIF0

Name Port Group IP Address Netmask broadcast Enabled DHCP

vswif0 Service Console 192.168.1.50 255.255.255.0 192.168.1.255 true False

[Email protected] root]# esxcfg-vswitch–l

Switch Name Num Ports used Ports configured Ports MTU uplinks

VSwitch0 5 Vmnic0

PortGroup Name VLAN ID used Ports uplinks

Service Console 0 1 vmnic0

[[Email protected] root]# service mgmt-vmware Restart #重启服务, where you can normally use VI to connect to ESX

--------------↓ If you accidentally configure the error to delete, please see below ↓---------------

[[email protected] root]# esxcfg-vswif–l #vswif0代表的虚拟网卡的interface0, service console corresponds to VSWIF0

Name Port Group IP Address Netmask broadcast Enabled DHCP

vswif0 Service Console 192.168.1.1 255.255.255.0 192.168.1.255 true False

[Email protected] root]# esxcfg-vswif-d vswif0 #删除vswif0

[Email protected] root]# esxcfg-vswitch-l

Switch Name Num Ports used Ports configured Ports MTU uplinks

VSwitch0 5 Vmnic0

PortGroup Name VLAN ID used Ports uplinks

Service Console 0 1 vmnic0

[Email protected] root]# esxcfg-vswitch–d "Service Console" VSwitch0 #删除vSwitch0上面portgroup

[[email protected] root]# esxcfg-vswitch–d "VM Network" VSwitch0

[Email protected] root]# esxcfg-vswitch-d vSwitch0 #删除vswitch0

[Email protected] root]# esxcfg-vswitch–l #之前操作删除了vswitch信息, is now blank

Switch Name Num Ports used Ports configured Ports MTU uplinks

PortGroup Name VLAN ID used Ports uplinks

2. If not, check the following configuration file.

[Email protected] root]# vi/etc/sysconfig/network #这里纪录主机名字和网关

Networking=yes

Hostname=vi3

gateway=192.168.251.12 #网关

Gatewaydev=vswif0 #网关指定在vswif0

[Email protected] root]# vi/etc/sysconfig/network-scripts/ifcfg-vswif0 #看看这里的信息是否跟之前配置吻合

DEVICE=VSWIF0 #之前把service cosole associated with vswif0

macaddr=00:50:56:43:a3:52

PORTGROUP=PORTGROUP6 #这里的protgroup与service Console Consistent

Bootproto=static

broadcast=192.168.251.255

ipaddr=192.168.251.60 #与service Console Consistent

netmask=255.255.255.0

Onboot=yes

If the above inconsistencies, you can manually change

In the VI editor, the I key is insert mode, the text changes, the ESC key exits the Insert mode: Wq Save and exit.

Edit complete reboot. The display address may be different from the settings after startup, but you can use VI to connect to ESX

FIX: If you only want to modify the service console IP, you can execute the following command directly:

Esxcfg-vswif-i xxx.xxx.xxx.xxx vswif<x>

VMware esx Common commands and IP address modifications

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.