命令记不住

登陆

Esxi 终端进行网络上传超大文件

Esxi终端进行网络上传超大文件

1.Esxi的防火墙使用

命令 描述
esxcli network firewall get 返回防火墙的启用或禁用状态并列出默认操作。
esxcli network firewall set --default-action 更新默认操作。
esxcli network firewall set --enabled 设置为 true 可启用防火墙,设置为 false 可禁用防火墙。
esxcli network firewall load 加载防火墙模块和规则集配置文件。
esxcli network firewall refresh 如果已加载防火墙模块,通过读取规则集文件刷新防火墙配置。
esxcli network firewall unload 销毁筛选器并卸载防火墙模块。
esxcli network firewall ruleset list 列出规则集信息。
esxcli network firewall ruleset set --allowedall 设置 allowedall 标记。
esxcli network firewall ruleset set --enabled 启用或禁用指定规则集。
esxcli network firewall ruleset allowedip list 列出指定规则集允许的 IP 地址。
esxcli network firewall ruleset allowedip add 允许访问指定 IP 地址或 IP 地址范围的规则集。
esxcli network firewall ruleset allowedip remove 移除对指定 IP 地址或 IP 地址范围的规则集的访问权限。

2.关闭Esxi的防火墙进行网络传输文件

[root@idc-723-b08-5-e1-b2:/vmfs/volumes/5c06287a-149a1b0e-a3ed-0017a4776004/ISO] esxcli network firewall 
Usage: esxcli network firewall {cmd} [cmd options]

Available Namespaces:
  ruleset               Commands to list and update firewall ruleset configuration

Available Commands:
  get                   Get the firewall status.
  load                  Load firewall module and rulesets configuration.
  refresh               Load ruleset configuration for firewall.
  set                   Set firewall enabled status and default action.
[root@idc-723-b08-5-e1-b2:/vmfs/volumes/5c06287a-149a1b0e-a3ed-0017a4776004/ISO] esxcli network firewall get
   Default Action: DROP
   Enabled: true
[root@idc-723-b08-5-e1-b2:] esxcli network firewall set --enabled false
或者
[root@idc-723-b08-5-e1-b2:] esxcli network firewall unload
[root@idc-723-b08-5-e1-b2:/vmfs/volumes/5c06287a-149a1b0e-a3ed-0017a4776004/ISO] esxcli network firewall get
Default Action: PASS
   Enabled: false

3.开始上传网络上的大文件

wget支持很多网络协议

Usage: wget [-csq] [-O FILE] [-Y on/off] [-P DIR] [-U AGENT] URL...

Retrieve files via HTTP or FTP

	-s	Spider mode - only check file existence
	-c	Continue retrieval of aborted transfer
	-q	Quiet
	-P DIR	Save to DIR (default .)
	-O FILE	Save to FILE ('-' for stdout)
	-U STR	Use STR for User-Agent header
	-Y	Use proxy ('on' or 'off')
[root@idc-723-b08-5-e1-b2:] wget  ftp://ftpuser:[email protected]/suse/SLE-12-SP4-Server-DVD-x86_64-GM-DVD1.iso -P /vmfs/volumes/5c06287a-149a1b0e-a3ed-0017a4776004/ISO
Connecting to 10.8.17.22 (10.8.17.22:21)
SLE-12-SP4-Server-DV 100% |**********************************************************************************|  4112M  0:00:00 ETA

#查看上传好的镜像文件
[root@idc-723-b08-5-e1-b2:/vmfs/volumes/5c06287a-149a1b0e-a3ed-0017a4776004/ISO] ls
2008&2012UserAgent.iso                      Linux标准化配置脚本V3.iso                   Software.iso                                rhel-server-6.8-x86_64-dvd.iso
DBC.ISO                                     SLE-12-SP4-Server-DVD-x86_64-GM-DVD1.iso  

4.恢复Esxi的防火墙状态

[root@idc-723-b08-5-e1-b2:] esxcli network firewall set --enabled true
或者
[root@idc-723-b08-5-e1-b2:] esxcli network firewall load
[root@idc-723-b08-5-e1-b2:/vmfs/volumes/5c06287a-149a1b0e-a3ed-0017a4776004/ISO] esxcli network firewall get
Default Action: DROP
   Enabled: true
   Loaded: true
推荐阅读