散尽浮华 2023

過去心不可得,現在心不可得,未來心不可得。
安寻安放,不卑不亢;重剑无锋,大巧不工!
  1. 首页
  2. vmware
  3. 正文

VMware ESXi:通过命令行配置虚拟交换机vSwitch1

2022年4月12日 1221点热度 0人点赞 0条评论

1、添加虚拟交换机 vSwitch1:

esxcli network nic list

esxcli network vswitch standard add --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic0 --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch1
esxcli network vswitch standard set --mtu=9000 --vswitch-name vSwitch1

2、绑定及故障切换策略:

esxcli network vswitch standard policy failover get -v vSwitch1
esxcli network vswitch standard policy failover set -a vmnic0,vmnic1 -v vSwitch1
esxcli network vswitch standard policy failover set -a vmnic0,vmnic1 -b true -f link -l explicit -n true -v vSwitch1
esxcli network vswitch standard policy failover get -v vSwitch1

3、配置安全策略

esxcli network vswitch standard policy security set -f true -m true -p false -v vSwitch0
esxcli network vswitch standard policy security set -f true -m true -p false -v vSwitch1
esxcli network vswitch standard policy security get -v vSwitch0
esxcli network vswitch standard policy security get -v vSwitch1

4、添加端口组:

esxcli network vswitch standard portgroup add --portgroup-name="172.16.42.0" --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup set --portgroup-name="172.16.42.0" --vlan-id=600

esxcli network vswitch standard portgroup add --portgroup-name="100.1.2.0" --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup set --portgroup-name="100.1.2.0" --vlan-id=700

5、配置vMotion接口:

esxcli network vswitch standard portgroup add --portgroup-name="vMotion" --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup set --portgroup-name="vMotion" --vlan-id=1010
esxcli network ip interface add --interface-name=vmk1 --portgroup-name=vMotion
esxcli network ip interface ipv4 set -g 10.10.10.254 --interface-name=vmk1 -I 10.10.10.55 -N 255.255.255.0 -t static
esxcli network ip interface set --mtu 9000 -i vmk1
esxcli network ip interface tag add -i vmk1 -t VMotion

附:查询命令

esxcfg-vmknic -l
vim-cmd hostsvc/vmotion/netconfig_get

esxcli network vswitch standard list
esxcli network ip interface list
标签: 暂无
最后更新:2022年4月12日

admin

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 散尽浮华 2023. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang