{"id":13,"date":"2008-02-14T10:23:33","date_gmt":"2008-02-14T01:23:33","guid":{"rendered":"https:\/\/hiro7216.mydns.jp\/blog\/?p=13"},"modified":"2024-01-30T23:40:56","modified_gmt":"2024-01-30T14:40:56","slug":"ip%e3%83%9e%e3%82%b9%e3%82%ab%e3%83%ac%e3%83%bc%e3%83%89%e3%82%92%e5%8b%95%e3%81%8b%e3%81%99%ef%bc%81","status":"publish","type":"post","link":"https:\/\/hiro7216.mydns.jp\/blog\/?p=13","title":{"rendered":"IP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u3092\u52d5\u304b\u3059\uff01"},"content":{"rendered":"\n<p>NIC\u306e\u4e8c\u679a\u633f\u3057\u3082\u7121\u4e8b\u7d42\u4e86\u3057\u305f\u3053\u3068\u3067\u3059\u3057NIC\u4e8c\u3064\u306eIP\u30bb\u30b0\u30e1\u30f3\u30c8\u9593\u3092\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u51fa\u6765\u308b\u3088\u3046\u306bIP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u306e\u767b\u9332\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>IP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u66f8\u3044\u3066\u3042\u308b\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><del>IP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u30eb\u30fc\u30bf\u306e\u69cb\u7bc9<\/del><\/p>\n\n\n\n<p>vi \/etc\/init.d\/ip-masq<\/p>\n\n\n\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u767b\u9332\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d<\/p>\n\n\n\n<p>#!\/bin\/sh<br>#<br># iptables \u3092\u7528\u3044\u3066\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u884c\u3046<br># \u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8<br>#<\/p>\n\n\n\n<p># IP \u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u6709\u52b9\u306b\u3059\u308b<br>echo 1 &gt; \/proc\/sys\/net\/ipv4\/ip_forward<\/p>\n\n\n\n<p># \u30c6\u30fc\u30d6\u30eb\u306e\u521d\u671f\u5316<br>iptables -t filter -F FORWARD<br>iptables -t nat -F POSTROUTING<br>iptables -t nat -F PREROUTING<\/p>\n\n\n\n<p># POSTROUTING, PREROUTING \u3068\u3082\u306b\u30a2\u30c9\u30ec\u30b9\u5909\u63db\u3092\u8a31\u53ef<br>iptables -t nat -P PREROUTING ACCEPT<br>iptables -t nat -P POSTROUTING ACCEPT<\/p>\n\n\n\n<p># \u30d5\u30a3\u30eb\u30bf\u306e\u8a2d\u5b9a: \u901a\u904e\u8a31\u53ef<br>iptables -t filter -P FORWARD ACCEPT<\/p>\n\n\n\n<p># \u5185\u90e8\u304b\u3089\u5916\u90e8\u3078\u306e IP \u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u3092\u8a31\u53ef<br>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/p>\n\n\n\n<p># ftp \u901a\u4fe1\u7528\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ed\u30fc\u30c9<br>\/sbin\/modprobe ip_nat_ftp<br>\/sbin\/modprobe ip_conntrack_ftp<\/p>\n\n\n\n<p>\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d<\/p>\n\n\n\n<p>\u8d77\u52d5\u6642\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u70ba\u306b\/etc\/init.d\/ip-masq\u3092rc.local\u306b\u767b\u9332\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3067\u8ffd\u52a0\u3057\u305fNIC\u30c7\u30d0\u30a4\u30b9\u306eIP\u304b\u3089LS-GL\u642d\u8f09\u306eNIC\u30c7\u30d0\u30a4\u30b9\u306eIP\u3078\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u304c\u51fa\u6765\u308b\u306f\u305a\u3067\u3042\u308b\u3002<br>\uff08\u8a2d\u5b9a\u4e0a\u9006\u306f\u51fa\u6765\u306a\u3044\u306f\u305a\uff09<br>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306egateway\u306b\u8ffd\u52a0\u3057\u305fNIC\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3059\u308c\u3070WAN\u5074\u306b\u3082\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u3067\u3059\u3002<br>\uff08eth0\u304cWAN\u306b\u7e4b\u304c\u3063\u3066\u3044\u308c\u3070\uff09<br>\u4f46\u3057DNS\u306e\u53d6\u5f97\u304c\u8ffd\u52a0\u3057\u305fIP\u304b\u3089\u306f\u884c\u3048\u306a\u3044\u306e\u3067DNS\u306f\u30d7\u30ed\u30d0\u30a4\u30c0\u63d0\u4f9b\u306eDNS\u306eIP\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u308a\u307e\u3059\u3002<br>\u203b\u4eca\u5f8cLS-GL\u306bDNS\u30b5\u30fc\u30d0\u30fc\uff06DHCP\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u7f6e\u3092\u8003\u3048\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u4e8c\u3064\u3092\u52d5\u304b\u305b\u3070\u5b8c\u5168\u30eb\u30fc\u30bf\u5316\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002<br>\u203bDNS\u30b5\u30fc\u30d0\u30fc\u306e\u30a2\u30d7\u30ea\u306e\u9078\u5b9a\u306a\u3069\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u305d\u3061\u3089\u306f\u3082\u3046\u5c11\u3057\u304a\u5f85\u3061\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>debian\u3067\u306f\u57fa\u672c\u7684\u306biptables\u95a2\u9023\u306e\u521d\u671f\u5316\u306f\/etc\/network\/interfaces\u5185\u306b<br>if-up\u3084pre-up\u3001up\u306a\u3069\u3092\u4f7f\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u306e\u8d77\u52d5\u3068\u9023\u52d5\u3055\u305b\u308b\u306e\u304c\u4e00\u822c\u7684\u306a\u3088\u3046\u3067\u3059\u3002<br>\uff08\u4ee5\u524d\u306e\u8a18\u4e8b\u306eIP\u30d5\u30a3\u30eb\u30bf\u30fc\u3082\u540c\u69d8\u306b\u3059\u308b\u306e\u304c\u671b\u307e\u3057\u3044\u3088\u3046\u3067\u3059\uff09<br>\u305f\u3060\u4eca\u56de\u306fNIC\u4e8c\u679a\u3067\u30b5\u30fc\u30d0\u30fc\u3092\u904b\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3069\u3061\u3089\u3068\u9023\u52d5\u3055\u305b\u308b\u304b\u3084<br>\u4e8c\u91cd\u306b\u9023\u52d5\u3057\u305f\u308a\u3057\u306a\u3044\u304b\u306a\u3069\u4e0d\u5b89\u8981\u7d20\u3082\u591a\u304b\u3063\u305f\u306e\u3067\u8d77\u52d5\u6642\u306b\uff11\u56de\u3060\u3051\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u8fba\u308a\u306e\u52d5\u304d\u304c\u4eca\u5f8c\u5b8c\u5168\u306b\u63b4\u3081\u305f\u3089interfaces\u5185\u306b\u79fb\u884c\u3059\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br>\u672c\u6765\u306f\u30c7\u30d0\u30a4\u30b9\u306e\u8d77\u52d5\u3068\u9023\u52d5\u3057\u306a\u3044\u3068\u30c7\u30d0\u30a4\u30b9\u8d77\u52d5\u3068\u30b9\u30af\u30ea\u30d7\u30c8\u9069\u7528\u306e\u305d\u306e\u50c5\u304b\u306a\u6642\u9593\u306b<br>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u304c\u5f31\u3044\u6642\u9593\u5e2f\u304c\u5b58\u5728\u3059\u308b\u306e\u3067\u7406\u89e3\u3055\u308c\u3066\u3044\u308b\u65b9\u306f\u30c7\u30d0\u30a4\u30b9\u9023\u52d5\u306b\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3057\u3059\u3079\u304d\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NIC\u306e\u4e8c\u679a\u633f\u3057\u3082\u7121\u4e8b\u7d42\u4e86\u3057\u305f\u3053\u3068\u3067\u3059\u3057NIC\u4e8c\u3064\u306eIP\u30bb\u30b0\u30e1\u30f3\u30c8\u9593\u3092\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u51fa\u6765\u308b\u3088\u3046\u306bIP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u306e\u767b\u9332\u3092\u884c\u3044\u307e\u3059\u3002 IP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u66f8\u3044\u3066\u3042\u308b\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002 IP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u30eb\u30fc\u30bf\u306e &hellip; <a href=\"https:\/\/hiro7216.mydns.jp\/blog\/?p=13\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">IP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u3092\u52d5\u304b\u3059\uff01<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,287],"tags":[166],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-linkstation","category-nas","tag-linkstation"],"_links":{"self":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":0,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"wp:attachment":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}