{"id":5574,"date":"2011-04-11T15:44:11","date_gmt":"2011-04-11T06:44:11","guid":{"rendered":"http:\/\/fukata.org\/?p=5574"},"modified":"2017-08-11T23:08:00","modified_gmt":"2017-08-11T23:08:00","slug":"virtualbox-nat","status":"publish","type":"post","link":"https:\/\/blog.fukata.org\/archives\/5574\/","title":{"rendered":"VirtualBox\u306eNAT\u306b\u3088\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\u30e1\u30e2"},"content":{"rendered":"

\u30ed\u30fc\u30ab\u30eb\u306e\u958b\u767a\u74b0\u5883\u3067DB\u30b5\u30fc\u30d0\u306a\u3069\u3092VirtualBox\u4e0a\u306b\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u969b\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304c\u5909\u308f\u3063\u3066\u3082\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u306a\u304f\u3066\u826f\u3044\u3088\u3046\u306b\u30d6\u30ea\u30c3\u30b8\u3067\u306f\u306a\u304f\u3001NAT\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002\u6700\u521d\u3001VMWare\u304b\u3089VirtualBox\u306b\u79fb\u884c\u3057\u305f\u969b\u306b\u3001NAT\u74b0\u5883\u306e\u69cb\u7bc9\u306b\u624b\u9593\u53d6\u3063\u305f\u306e\u3092\u899a\u3048\u3066\u3044\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3001\u30e1\u30e2\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

\u5177\u4f53\u7684\u306b\u306f\u3001VirtualBox\u306eNIC\u3067NAT\u3092\u9078\u3093\u3060\u5834\u5408\u3001Guest -> Host\u3078\u306e\u63a5\u7d9a\u306fOK\u3067\u3082Host -> Guest\u306e\u63a5\u7d9a\u306f\u51fa\u6765\u307e\u305b\u3093\u3002\u3053\u308c\u3058\u3083SSH\u306a\u3069\u3067\u63a5\u7d9a\u3067\u304d\u305a\u306b\u4e0d\u4fbf\u306a\u306e\u3067\u3001NAT\u3068Host-only Adapter\u3092\u4f75\u7528\u3057\u3066\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/p>\n

Adapter1: NAT
\nScreenshot-VirtualBox-Adapter1<\/a><\/p>\n

Adapter2: Host-only Adapter
\n
Screenshot-VirtualBox-Adapter2<\/a><\/p>\n

Ubuntu\u306e\u5834\u5408\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\/etc\/network\/interface\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002
\neth1\u306fdhcp,static\u306b\u5408\u308f\u305b\u3066\u9069\u5f53\u306b\u30b3\u30e1\u30f3\u30c8\u3092\u89e3\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001static\u306e\u5834\u5408\u306fIP\u3082\u74b0\u5883\u3067\u5408\u308f\u305b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n

\r\n# The loopback network interface\r\nauto lo\r\niface lo inet loopback\r\n\r\n# The primary network interface\r\nauto eth0\r\niface eth0 inet dhcp\r\n\r\n# The secondary network interface\r\nauto eth1\r\n# if use dhcp network\r\n#iface eth1 inet dhcp\r\n# if use static network\r\n#iface eth1 inet static\r\n#address 192.168.56.110\r\n#netmask 255.255.255.0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u30ed\u30fc\u30ab\u30eb\u306e\u958b\u767a\u74b0\u5883\u3067DB\u30b5\u30fc\u30d0\u306a\u3069\u3092VirtualBox\u4e0a\u306b\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u969b\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304c\u5909\u308f\u3063\u3066\u3082\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u306a\u304f\u3066\u826f\u3044\u3088\u3046\u306b\u30d6\u30ea\u30c3\u30b8\u3067\u306f\u306a\u304f\u3001NAT\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002 … \u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":2,"featured_media":9223372036854775807,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1980],"tags":[863,862],"_links":{"self":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/5574"}],"collection":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/comments?post=5574"}],"version-history":[{"count":0,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/5574\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media\/9223372036854775807"}],"wp:attachment":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media?parent=5574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/categories?post=5574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/tags?post=5574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}