详细讲解:Linux操作系统下VMware的端口映射

日期: 2008-04-02 来源:TechTarget中国

  主机环境是UBUNTU 7.4


  VMware Workstation 6.0.0 build-45731vmware使用NAT是通过vmnet8来是实现,找到这个文件打开/etc/vmware/vmnet8/nat/nat.conf


  # be up to 100% longer


  timeout = 60


  [incomingtcp]


  # Use these with care – anyone can enter into your VM through these…


  # FTP (both active and passive FTP is always enabled)


  # ftp localhost 8887


  #8887 = 192.168.0.128:21


  4660 = 192.168.0.128:4660


  # WEB (make sure that if you are using named webhosting, names point to


  # your host, not to guest… And if you are forwarding port other


  # than 80 make sure that your server copes with mismatched port


  # number in Host: header)


  # lynx http://localhost:8888


  #8888 = 192.168.0.128:80


  # SSH


  # ssh -p 8889 root@localhost


  #8889 = 192.168.0.128:22


  [incomingudp]


  # UDP port forwarding example


  #6000 = 192.168.0.128:6001


  [incomingtcp]


  TCP映射


  [incomingudp]


  UDP映射


  举例


  8889 = 192.168.0.128:22


  保存退出,重启服务


  /usr/lib/vmware/net-services.sh restart


  测试


  ssh -p 8022 myhost.comornetstat -anpt ……..tcp 0 0 0.0.0.0:4660 0.0.0.0:* LISTEN 2500……..

我们一直都在努力坚持原创.......请不要一声不吭,就悄悄拿走。

我原创,你原创,我们的内容世界才会更加精彩!

【所有原创内容版权均属TechTarget,欢迎大家转发分享。但未经授权,严禁任何媒体(平面媒体、网络媒体、自媒体等)以及微信公众号复制、转载、摘编或以其他方式进行使用。】

微信公众号

TechTarget微信公众号二维码

TechTarget

官方微博

TechTarget中国官方微博二维码

TechTarget中国

电子邮件地址不会被公开。 必填项已用*标注

敬请读者发表评论,本站保留删除与本文无关和不雅评论的权力。

相关推荐