Chinaunix首页 | 论坛 | 博客
  • 博客访问: 579157
  • 博文数量: 158
  • 博客积分: 2696
  • 博客等级: 少校
  • 技术积分: 1668
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-10 00:49
个人简介

life?is?short?,?play?more!

文章分类

全部博文(158)

文章存档

2021年(1)

2013年(10)

2012年(4)

2011年(11)

2010年(27)

2009年(28)

2008年(52)

2007年(25)

我的朋友

分类:

2008-07-14 23:33:20

主要介绍2个命令
esxcfg-vswif 和 esxcfg-vswitch
以下命令参数均亲自测试
 
1.

esxcfg-vswif –l

 

可以看到我们添加的虚拟网卡

vswif55  Service Console     10.18.83.234     255.255.252.0    10.18.83.255     true      true

 

2.

删除虚拟网卡vswif99

esxcfg-vswif -d vswif99

 

3.

关闭虚拟网卡 vswif55

esxcfg-vswif -s vswif55

 

可以查看到 vswif55 已经处于不可用状态

Name     Port Group          IP Address       Netmask          Broadcast        Enabled   DHCP

vswif0   Service Console     10.18.80.150     255.255.252.0    10.18.83.255     true      true

vswif55  Service Console     N/A              N/A              N/A              false     true

 

4.

配置虚拟网卡 vswif55 ip地址,网络掩码 和广播地址

esxcfg-vswif -i 192.168.0.1 -n 255.255.255.0 -b 255.255.255.255 vswif55

 

5.

检查虚拟网卡

output returns 1 if the interface exists and  up, return 0 otherwise

返回1 说明此虚拟网卡存在且被激活

其他则是0(即标示不可用状态)

 

esxcfg-vswif -c vswif55

1 这个1是返回的值

 

6.

激活所有虚拟网卡

esxcfg-vswif –E

 

7.

禁用所有虚拟网卡

esxcfg-vswif –D

 

8.

关于虚拟交换机(virtual switch 的命令的基本操作和用法

 

查看虚拟switch的信息

esxcfg-vswitch -l

Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks

vSwitch0       64          5           64                1500    vmnic0

 

  PortGroup Name      VLAN ID  Used Ports  Uplinks

  VM Network          0        0           vmnic0

  Service Console     0        2           vmnic0

 

9.

添加一个新的虚拟switch

esxcfg-vswitch -a vSwitch10

 

虚拟switch 的名字必须 用vSwitch 开头

 

 

10.

查看真实的物理网卡

esxcfg-nics -l

Name    PCI      Driver      Link Speed    Duplex MTU    Description

vmnic1  02:04.00 bnx2        Up   1000Mbps Full   1500   Broadcom Corporation Broadcom NetXtreme II BCM5706 1000Base-SX

vmnic0  02:03.00 bnx2        Up   1000Mbps Full   1500   Broadcom Corporation Broadcom NetXtreme

 

11.

我们现在将 vmnic1 连接到 刚才新添加的虚拟switch10 上。

 

 

esxcfg-vswitch -L vmnic1 vSwitch10

 

成功添加

 

 

Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks

vSwitch10      64          3           64                1500    vmnic1

 

  PortGroup Name      VLAN ID  Used Ports  Uplinks

 

 

12

 

vmswitch10 上添加 portgroup (简称pg

 

esxcfg-vswitch --add-pg=new vSwitch10

 

添加后查看

Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks

vSwitch10      64          3           64                1500    vmnic1

 

  PortGroup Name      VLAN ID  Used Ports  Uplinks

  new                 0        0           vmnic1

 

13。

 

删除pg

esxcfg-vswitch --del-pg=new vSwitch10

 

14。

esxcfg-vswitch --check-pg=new vSwtich10

Check to see if a portgroup exists. Program outputs a 1 for exist 0 otherwise

 

 

15。

esxcfg-vswitch -U=vmnic1 vSwitch10

Removing from config file only

 

 

16。

 

删除vswitch

esxcfg-vswitch -d vSwitch10

 

 

 

 

阅读(1143) | 评论(2) | 转发(0) |
0

上一篇:vmkfstools 应用

下一篇:转 紫羅蘭之丘

给主人留下些什么吧!~~

chinaunix网友2008-07-15 18:39:58

别浪费脑细胞,记这些没用的dd :) 为什么这么做才是需要知道的。

chinaunix网友2008-07-15 15:56:52

我倒是看懂了这些命令,只是不知道 这些是干嘛用的。 记住这些很简单啊。就是不知道 为什么 要这么做