ESX4/ESXI5 使用命令更改網絡

ESX4.x網絡

[root@esx Server ~]#esxcfg-vswitch  –l     #查看當前虛擬交換機的配置,若是有端口,須要先刪除端口。
[root@esx Server ~]#esxcfg-vswif  –l      #顯示當前的虛擬網絡接口。
[root@esx Server ~]#esxcfg-vswif  –d   vswif0     #刪除名稱爲vswif0的虛擬網絡接口,若是有多個虛擬網絡
接口,須要分別刪除。
[root@esx Server ~]#esxcfg-vmknic  –l     #顯示當前的vmkernel類型的虛擬接
[root@esx Server ~]#esxcfg-vmknic –d  VMkernel    #刪除名稱爲VMkernel的虛擬接口,若是有多個虛擬網絡接
口,須要分別刪除。
[root@esx Server ~]#esxcfg-vswitch  –d  vSwitch0    #刪除名稱爲vSwitch0的虛擬交換機。
[root@esx Server ~]#esxcfg-vswitch –a  vSwitch0    #從新建立名稱爲vSwitch0的虛擬交換機。
[root@esx Server ~]#esxcfg-vswitch –A 「Service  Console」  vSwitch0     #爲虛擬交換機「vSwitch0」添加Ser
vcie Console端口組,名稱爲「Servcie Console」。
[root@esx Server ~]#esxcfg –a vswif0  –p  「Service Console」  –i  192.168.137.223  -n  255.255.255.0
   #爲Service Console端口組添加名稱爲vswif0的虛擬端口,ip地址爲192.168.137.223,子網掩碼是255.255.255
.0 。
[root@esx Server ~]#esxcfg-nics  –i    #查看當前ESX主機上的物理網卡。
[root@esx Server ~]#esxcfg-vswitch  -L  vmnic0  vSwitch0    #爲名稱爲vSwitch0的虛擬交換機添加上聯網卡
,網卡名稱爲vmnic0。
[root@esx Server ~]#esxcfg-vswitch  -l    #查看虛擬交換機的配置。
[root@esx Server ~]#esxcfg-vswif  -l     #查看虛擬端口的配置和IP地ide

ESXI 5.x接口

#esxcli  network  vswitch  standard  list   #查看虛擬交換機的配置,若是有正在工做的虛擬端口組,須要先刪除虛擬端口組
#esxcli  network  vswitch  standard  portgroup  list   #顯示端口組信息,若是有正在工做的端口,須要先刪除端口。
#esxcli  network  ip  interface  list   #查看當前網絡的虛擬網絡接口
#esxcli  network  ip  interface  remove  -i  vmk0  #刪除查到的vmk0端口。
若是有多個端口,須要逐一刪除。
#esxcli network  vswitch  standard remove –v  vSwitch0  #刪除名稱爲vSwitch0的虛擬交換機。
#esxcli  network  vswitch  standard  add  -v  vSwitch0  #建立名稱爲vSwitch0的虛擬交換機
#esxcli  network  vswitch  standard  portgroup add  -p  「management network」  -v  vSwitch0  #爲虛擬交換機vSwitch0添加端口組,名稱爲management network
#esxcli  network  ip  interface  add  -i  vmk0  -p 「management network」  #爲端口組management network添加虛擬接口,名稱爲vmk0
#esxcli  network  ip  interface  ipv4  set –i  vmk0  -I  192.168.137.223  -N 255.255.255.0  -t  static  #爲vmk0接口配置ip地址和子網掩碼。
#esxcli  network  nic  list   #查看ESXi Server上配置的物理網卡名稱和相關信息。
#esxcli  network  vswitch  standard uplink  add  -u  vmnic0  -v  vSwitch0  #爲名稱爲vSwitch0的虛擬交換機添加上聯物理網卡vmnic0。
#esxcli  network  vswitch  standard  list  #查看虛擬交換機的配置信息ip

相關文章
相關標籤/搜索