0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VMware 12 Player上のCentOSの環境を設定 NAT

Posted at

仮想マシンの設定

ネットワークをNATに設定したので通信経路を設定する。
image.png

環境

  • ホスト Windows10 1703
  • VMware Workstation 12 Player 12.5.8 build-8097237
  • CentOS release 6.6 (Final)
  • IPアドレス固定

ホストの設定

「C:\ProgramData\VMware\vmnetnat.conf」を編集する。
※「C:\ProgramData」は隠し

~略~
# SSH
#      ssh -p 8889 root@localhost
# 8889 = 192.168.27.128:22
+ 8128 = 192.168.234.128:22

[incomingudp]
# UDP port forwarding example
# 6000 = 192.168.27.128:6001

[PrivilegedTCP]
autodetect = 1

[PrivilegedUDP]
autodetect = 1

Windows の VMware NAT Service を停止→開始する。
image.png

Windows でポートを確認する。
8128 が「LISTENING」になっていればOK

C:\>netstat -nao

アクティブな接続

  プロトコル  ローカル アドレス      外部アドレス           状態            PID
  TCP         0.0.0.0:80             0.0.0.0:0              LISTENING       4
  TCP         0.0.0.0:135            0.0.0.0:0              LISTENING       812
  TCP         0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP         0.0.0.0:902            0.0.0.0:0              LISTENING       2960
  TCP         0.0.0.0:912            0.0.0.0:0              LISTENING       2960
  TCP         0.0.0.0:1801           0.0.0.0:0              LISTENING       2760
  TCP         0.0.0.0:2103           0.0.0.0:0              LISTENING       2760
  TCP         0.0.0.0:2105           0.0.0.0:0              LISTENING       2760
  TCP         0.0.0.0:2107           0.0.0.0:0              LISTENING       2760
  TCP         0.0.0.0:2425           0.0.0.0:0              LISTENING       8172
  TCP         0.0.0.0:3389           0.0.0.0:0              LISTENING       1164
  TCP         0.0.0.0:5357           0.0.0.0:0              LISTENING       4
  TCP         0.0.0.0:8128           0.0.0.0:0              LISTENING       8912
  TCP         0.0.0.0:49664          0.0.0.0:0              LISTENING       824
~略~

確認

teratermで接続できることを確認する。
※192.168.0.151は、ホストOSのIPアドレス
※ポートは、ホストの設定で設定したポートを指定
image.png

接続を確認できた。

[root@localhost ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:0C:29:A2:37:AE
          inet addr:192.168.234.128  Bcast:192.168.234.255  Mask:255.255.255.0
          inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:411 errors:0 dropped:0 overruns:0 frame:0
          TX packets:264 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:49650 (48.4 KiB)  TX bytes:49172 (48.0 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:240 (240.0 b)  TX bytes:240 (240.0 b)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?