前言windows-hosts和linux-host文件

windows位置:C:\Windows\System32\drivers\etc

linux位置:/etc/hosts

一. 将linux本地grafana端口3000映射到外网9000端口

esxi 设定端口映射 esxi虚拟机端口映射_esxi 设定端口映射

esxi 设定端口映射 esxi虚拟机端口映射_github_02

 二. 访问 http://ip:9000

esxi 设定端口映射 esxi虚拟机端口映射_github_03

 成功!

二. windows-hosts文件编辑

hosts文件主要是为了做IP地址和机器名映射!

习惯了Linux下面的位置/etc/hosts,一时间还找不到Windows的对应文件在哪。

这里这里:

C:\Windows\System32\drivers\etc

然后,直接编辑HOSTS文件,在最后添加需要的IP地址和机器名,保存即可!
10.1.10.1 myhostname1
10.1.10.2 myhostname2

编辑:

esxi 设定端口映射 esxi虚拟机端口映射_linux_04

 访问:gegewu.com:9000

esxi 设定端口映射 esxi虚拟机端口映射_linux_05

 成功!

linux-hosts设置 文件位置:/etc/hosts

esxi 设定端口映射 esxi虚拟机端口映射_esxi 设定端口映射_06

esxi 设定端口映射 esxi虚拟机端口映射_esxi 设定端口映射_07

注:可以将常用的ip写入此文件方便记忆如github等,绕过域名解析提高访问速度。 

成功!