ablog

不器用で落着きのない技術者のメモ

VMware Fusion 3 上のゲストOSからホストOSの外のネットワークに接続する方法

環境

手順

# Linux NAT configuration file
[host]
# NAT gateway address
ip = 192.168.45.2
netmask = 255.255.255.0
# VMnet device if not specified on command line
device = /dev/vmnet8
# Allow PORT/EPRT FTP commands (they need incoming TCP stream ...)
activeFTP = 1
# Allows the source to have any OUI.  Turn this one if you change the OUI
# in the MAC address of your virtual machines.
allowAnyOUI = 1
[udp]
# Timeout in seconds, 0 = no timeout, default = 60; real value might
# be up to 100% longer
timeout = 60
[incomingudp]

[incomingtcp]
# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=centos54.ablog.jp
GATEWAY=192.168.45.2
  • 設定を有効化する。
# service network restart
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.45.0    *               255.255.255.0   U     0      0        0 eth0
169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
default         192.168.45.2    0.0.0.0         UG    0      0        0 eth0
  • DNS サーバを設定する
# vi /etc/resolv.conf 
nameserver 192.168.0.1
  • www.google.com に ping が通ることを確認する。
# ping www.google.com
PING www.google.comf.ablog.jp (210.188.201.60) 56(84) bytes of data.
64 bytes from sv90.xserver.jp (210.188.201.60): icmp_seq=1 ttl=128 time=17.6 ms
64 bytes from sv90.xserver.jp (210.188.201.60): icmp_seq=2 ttl=128 time=18.0 ms
64 bytes from sv90.xserver.jp (210.188.201.60): icmp_seq=3 ttl=128 time=18.5 ms
...