{"id":281,"date":"2018-11-10T17:07:12","date_gmt":"2018-11-10T08:07:12","guid":{"rendered":"https:\/\/0x0c.info\/?p=281"},"modified":"2018-11-10T17:07:12","modified_gmt":"2018-11-10T08:07:12","slug":"%e3%80%90iptables%e3%80%91-centos6%e3%81%a7keepalived%e3%81%8c%e4%b8%a1%e3%83%9e%e3%82%b9%e3%82%bf%e3%82%b9%e3%83%97%e3%83%aa%e3%83%83%e3%83%88%e3%83%96%e3%83%ac%e3%82%a4%e3%83%b3%e3%81%ab%e3%81%aa","status":"publish","type":"post","link":"https:\/\/0x0c.info\/?p=281","title":{"rendered":"\u3010iptables\u3011 CentOS6\u3067keepalived\u304c\u4e21\u30de\u30b9\u30bf(\u30b9\u30d7\u30ea\u30c3\u30c8\u30d6\u30ec\u30a4\u30f3)\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3092\u89e3\u6d88\u3059\u308b"},"content":{"rendered":"<p>\t\t\t\tCentOS6\u3067keepalived\u3092\u8907\u6570\u53f0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u8d77\u52d5\u3057\u3066 <code>\/var\/log\/messages<\/code> \u3092\u898b\u3066\u307f\u305f\u3089\u3001\u5404\u30b5\u30fc\u30d0\u3067 <code>Entering MASTER STATE<\/code> \u306b\u306a\u3063\u305f\u307e\u307e\u3001\u4e00\u5411\u306b <code>Entering BACKUP STATE<\/code> \u306b\u306a\u308b\u6c17\u914d\u304c\u306a\u3044\u3002<br \/>\n<code>ip a<\/code> \u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304f\u3068\u5404\u30b5\u30fc\u30d0\u3067\u4eee\u60f3ip\u304c\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u3068\u3044\u3046\u554f\u984c\u306e\u539f\u56e0\u306f\u3001\u304a\u305d\u3089\u304f iptables \u306e\u8a2d\u5b9a\u3067\u3001VRRP\u30d1\u30b1\u30c3\u30c8\u304c REJECT \u3055\u308c\u3066\u3057\u307e\u3044\u3001VRRP\u30d1\u30b1\u30c3\u30c8\u304c\u30b5\u30fc\u30d0\u9593\u3067\u758f\u901a\u3057\u3066\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p><code>iptables-save<\/code> \u30b3\u30de\u30f3\u30c9\u3067iptables\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3001 <code>-A INPUT -p vrrp -j ACCEPT<\/code> \u304c <code>-A INPUT -j REJECT ...(--reject-with icmp-host-prohibited \u3068\u304b)<\/code>\u3088\u308a\u4e0a\u306b\u5165\u3063\u3066\u3044\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\n<code>-A OUTPUT -p vrrp -j ACCEPT<\/code> \u3082\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f<\/p>\n<pre><code>iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited\niptables -A INPUT -p vrrp -j ACCEPT\niptables -A OUTPUT -p vrrp -j ACCEPT\niptables -A INPUT -j REJECT --reject-with icmp-host-prohibited\niptables-save   (\u8a2d\u5b9a\u3092\u8868\u793a\u3057\u3066\u78ba\u8a8d)\n\nservice iptables save   (\u8a2d\u5b9a\u3092\u30bb\u30fc\u30d6)\n\nservice iptables restart\n<\/code><\/pre>\n<p>\u3068\u3044\u3046\u611f\u3058\u306b\u306a\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306bVRRP\u306f\u30d7\u30ed\u30c8\u30b3\u30eb\u756a\u53f7112\u306eIP\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3001UDP(\u30d7\u30ed\u30c8\u30b3\u30eb\u756a\u53f717),TCP(\u30d7\u30ed\u30c8\u30b3\u30eb\u756a\u53f76),ICMP(\u30d7\u30ed\u30c8\u30b3\u30eb\u756a\u53f71) \u3068\u306f\u5225\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3059\u306e\u3067\u3001TCP\u3084UDP\u306a\u3069\u306f\u5185\u90e8\u30bb\u30b0\u30e1\u30f3\u30c8\u3067\u5168\u90e8\u901a\u3057\u3066\u308b\u306e\u306b\u306a\u3093\u3067\u758f\u901a\u3057\u306a\u3044\u306e\u304b\u306a\u3001\u3068\u601d\u3044\u304c\u3061\u3067\u3059\u306d\u3002\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS6\u3067keepalived\u3092\u8907\u6570\u53f0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u8d77\u52d5\u3057\u3066 \/var\/log\/messages \u3092\u898b\u3066\u307f\u305f\u3089\u3001\u5404\u30b5\u30fc\u30d0\u3067 Entering MASTER STATE \u306b\u306a\u3063\u305f\u307e\u307e\u3001\u4e00\u5411\u306b Entering BACKUP STATE \u306b\u306a\u308b\u6c17\u914d\u304c\u306a\u3044\u3002 ip a \u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304f\u3068\u5404\u30b5\u30fc\u30d0\u3067\u4eee\u60f3ip\u304c\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3002 \u3068\u3044\u3046\u554f\u984c\u306e\u539f\u56e0\u306f\u3001\u304a\u305d\u3089\u304f iptables \u306e\u8a2d\u5b9a\u3067\u3001VRRP\u30d1\u30b1\u30c3\u30c8\u304c REJECT \u3055\u308c\u3066\u3057\u307e\u3044\u3001VRRP\u30d1\u30b1\u30c3\u30c8\u304c\u30b5\u30fc\u30d0\u9593\u3067\u758f\u901a\u3057\u3066\u306a\u3044\u304b\u3089\u3067\u3059\u3002 iptables-save \u30b3\u30de\u30f3\u30c9\u3067iptables\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3001 -A INPUT -p vrrp -j ACCEPT \u304c -A INPUT -j REJECT &#8230;(&#8211;reject-with icmp-host-prohibited \u3068\u304b)\u3088\u308a\u4e0a\u306b\u5165\u3063\u3066\u3044\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002 -A OUTPUT -p vrrp -j ACCEPT \u3082\u5fc5\u8981\u3067\u3059\u3002 \u5177\u4f53\u7684\u306b\u306f iptables -D INPUT -j REJECT &#8211;reject-with icmp-host-prohibited iptables -A INPUT -p vrrp &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/0x0c.info\/?p=281\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;\u3010iptables\u3011 CentOS6\u3067keepalived\u304c\u4e21\u30de\u30b9\u30bf(\u30b9\u30d7\u30ea\u30c3\u30c8\u30d6\u30ec\u30a4\u30f3)\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3092\u89e3\u6d88\u3059\u308b&#8221;<\/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":[4],"tags":[15,19,36,43,49,78,121],"class_list":["post-281","post","type-post","status-publish","format-standard","hentry","category-linux","tag-backup-state","tag-centos","tag-iptables","tag-keepalived","tag-master-state","tag-vrrp","tag-121"],"_links":{"self":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/posts\/281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=281"}],"version-history":[{"count":0,"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/posts\/281\/revisions"}],"wp:attachment":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}