{"id":4698,"date":"2018-05-23T11:49:31","date_gmt":"2018-05-23T04:49:31","guid":{"rendered":"https:\/\/cloud.z.com\/vn\/?p=4698"},"modified":"2018-05-23T15:47:53","modified_gmt":"2018-05-23T08:47:53","slug":"su-dung-can-bang-tai","status":"publish","type":"post","link":"https:\/\/cloud.z.com\/vn\/support\/support-network\/su-dung-can-bang-tai\/","title":{"rendered":"S\u1eed d\u1ee5ng c\u00e2n b\u1eb1ng t\u1ea3i"},"content":{"rendered":"<p><\/p>\n<p>C\u00e2n b\u1eb1ng t\u1ea3i c\u1ee7a Z.com cung c\u1ea5p ch\u1ee9c n\u0103ng ph\u00e2n ph\u1ed1i l\u01b0u l\u01b0\u1ee3ng truy c\u1eadp \u0111\u1ebfn VPS. B\u1ea1n c\u00f3 th\u1ec3 ph\u00e2n ph\u1ed1i t\u1ea3i ho\u1eb7c t\u1ea1o h\u1ec7 th\u1ed1ng d\u1ef1 ph\u00f2ng. Ph\u01b0\u01a1ng th\u1ee9c chuy\u1ec3n g\u00f3i l\u00e0 ph\u01b0\u01a1ng ph\u00e1p DSR. V\u00ec \u0111\u00e2y l\u00e0 ph\u01b0\u01a1ng ph\u00e1p c\u1ea7n thi\u1ebft \u0111\u1ec3 chuy\u1ec3n c\u00e1c g\u00f3i tin tr\u1ef1c ti\u1ebfp t\u1eeb VPS cho kh\u00e1ch h\u00e0ng n\u00ean s\u1ebd c\u1ea7n ph\u1ea3i thi\u1ebft l\u1eadp n\u00f3 tr\u00ean VPS (OS). D\u01b0\u1edbi \u0111\u00e2y, ch\u00fang t\u00f4i xin gi\u1edbi thi\u1ec7u m\u1ed9t v\u00ed d\u1ee5 thi\u1ebft l\u1eadp.<\/p>\n<div style=\"background: #d62825; padding: 10px; font-size: 15px;\"><span style=\"color: #ffffff;\">T\u1ea1o danh s\u00e1ch Health Monitor<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>Health Monitor gi\u00fap x\u00e1c \u0111\u1ecbnh c\u00e1c b\u1ed9 c\u00e2n b\u1eb1ng t\u1ea3i Health check (theo d\u00f5i tr\u1ef1c ti\u1ebfp) cho m\u00e1y ch\u1ee7 \u0111\u00edch. C\u00e2n b\u1eb1ng t\u1ea3i c\u1ee7a Z.com c\u00f3 th\u1ec3 ch\u1ecdn t\u1eeb ba giao th\u1ee9c: HTTP, TCP v\u00e0 PING. Vui l\u00f2ng ch\u1ecdn giao th\u1ee9c ph\u00f9 h\u1ee3p v\u1edbi d\u1ecbch v\u1ee5 c\u00e2n b\u1eb1ng t\u1ea3i.<\/p>\n<p>[1] Click v\u00e0o [M\u1ea1ng] t\u1eeb tr\u00ecnh \u0111\u01a1n b\u00ean tr\u00e1i<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2017\/08\/vps1-1.png\" rel=\"attachment wp-att-3119\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-3119\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2017\/08\/vps1-1.png\" alt=\"vps1\" width=\"710\" height=\"391\" \/><\/a><\/p>\n<p>[2] Ch\u1ecdn [Danh s\u00e1ch Health Monitor] t\u1eeb C\u00e2n b\u1eb1ng t\u1ea3i v\u00e0 click v\u00e0o bi\u1ec3u t\u01b0\u1ee3ng [C\u00e0i \u0111\u1eb7t]<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb1-1.png\" rel=\"attachment wp-att-4703\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4703\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb1-1.png\" alt=\"lb1-1\" width=\"710\" height=\"243\" \/><\/a><\/p>\n<p>[3] Click v\u00e0o [+]<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb4.png\" rel=\"attachment wp-att-4704\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4704\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb4.png\" alt=\"lb4\" width=\"710\" height=\"148\" \/><\/a><\/p>\n<p>[4] Sau khi ch\u1ecdn v\u00e0 nh\u1eadp c\u00e1c gi\u00e1 tr\u1ecb ph\u00f9 h\u1ee3p cho m\u1ed7i m\u1ee5c, click v\u00e0o n\u00fat [L\u01b0u]<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb5.png\" rel=\"attachment wp-att-4705\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4705\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb5.png\" alt=\"lb5\" width=\"710\" height=\"262\" \/><\/a><\/p>\n<p>[5] Health Monitor \u0111\u00e3 \u0111\u01b0\u1ee3c t\u1ea1o<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb11.jpg\" rel=\"attachment wp-att-4740\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4740\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb11.jpg\" alt=\"lb11\" width=\"710\" height=\"204\" \/><\/a><\/p>\n<div style=\"background: #d62825; padding: 10px; font-size: 15px;\"><span style=\"color: #ffffff;\">T\u1ea1o c\u00e2n b\u1eb1ng t\u1ea3i<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>[1] Click v\u00e0o [+ C\u00e2n b\u1eb1ng t\u1ea3i]<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb1.png\" rel=\"attachment wp-att-4708\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4708\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb1.png\" alt=\"lb1\" width=\"710\" height=\"243\" \/><\/a><\/p>\n<p>[3] Sau khi ch\u1ecdn [Khu v\u1ef1c] m\u00e0 b\u1ea1n mong mu\u1ed1n, click [Th\u00eam m\u1edbi]<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb2.png\" rel=\"attachment wp-att-4709\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4709\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb2.png\" alt=\"lb2\" width=\"710\" height=\"292\" \/><\/a><\/p>\n<p>[4] M\u1ed9t c\u00e2n b\u1eb1ng t\u1ea3i \u0111\u00e3 \u0111\u01b0\u1ee3c th\u00eam m\u1edbi (\u0111\u1ecba ch\u1ec9 IP c\u1ee7a b\u1ed9 c\u00e2n b\u1eb1ng t\u1ea3i s\u1ebd kh\u00e1c nhau t\u00f9y thu\u1ed9c v\u00e0o m\u00f4i tr\u01b0\u1eddng v\u00e0 khu v\u1ef1c). Click v\u00e0o ph\u1ea7n \u0111\u1ecba ch\u1ec9 IP \u0111\u1ec3 hi\u1ec3n th\u1ecb th\u00f4ng tin chi ti\u1ebft c\u1ee7a c\u00e2n b\u1eb1ng t\u1ea3i.<\/p>\n<div style=\"background: #d62825; padding: 10px; font-size: 15px;\"><span style=\"color: #ffffff;\">Ti\u1ebfn h\u00e0nh thi\u1ebft l\u1eadp c\u00e2n b\u1eb1ng t\u1ea3i \u0111\u00edch<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>[1] \u0110\u1ec3 thi\u1ebft l\u1eadp c\u00e2n b\u1eb1ng t\u1ea3i cho m\u1ed7i c\u1ed5ng TCP, tr\u01b0\u1edbc ti\u00ean h\u00e3y ch\u1ecdn c\u1ed5ng ngu\u1ed3n c\u00e2n b\u1eb1ng t\u1ea3i.\u00a0Ti\u1ebfp theo, click v\u00e0o bi\u1ec3u t\u01b0\u1ee3ng c\u00e0i \u0111\u1eb7t \u0111\u1ec3 ti\u1ebfn h\u00e0nh c\u1ea5u h\u00ecnh m\u00e1y ch\u1ee7 c\u00e2n b\u1eb1ng t\u1ea3i.<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb7-1.png\" rel=\"attachment wp-att-4711\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4711\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb7-1.png\" alt=\"lb7-1\" width=\"710\" height=\"304\" \/><\/a><\/p>\n<p>[3] Ch\u1ecdn [Ph\u01b0\u01a1ng ph\u00e1p c\u00e2n b\u1eb1ng t\u1ea3i] v\u00e0 [Health Monitor] t\u01b0\u01a1ng \u1ee9ng v\u00e0 th\u00eam \u0111\u1ecba ch\u1ec9 IP \u0111\u00edch cho c\u00e2n b\u1eb1ng t\u1ea3i. Ph\u01b0\u01a1ng ph\u00e1p c\u00e2n b\u1eb1ng t\u1ea3i nh\u01b0 sau.<\/p>\n<p>Round Robin: Ph\u00e2n ph\u1ed1i \u0111\u1ed3ng \u0111\u1ec1u cho m\u1ed7i m\u00e1y ch\u1ee7.<br \/> Lease Connection: Ph\u00e2n b\u1ed5 cho c\u00e1c m\u00e1y ch\u1ee7 c\u00f3 s\u1ed1 l\u01b0\u1ee3ng k\u1ebft n\u1ed1i \u00edt nh\u1ea5t.<br \/> Sau khi c\u00e0i \u0111\u1eb7t, click v\u00e0o [L\u01b0u].<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb8.png\" rel=\"attachment wp-att-4713\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4713\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb8.png\" alt=\"lb8\" width=\"710\" height=\"312\" \/><\/a><\/p>\n<p>[4] Thi\u1ebft l\u1eadp c\u00e2n b\u1eb1ng t\u1ea3i \u0111\u00edch \u0111\u00e3 \u0111\u01b0\u1ee3c ho\u00e0n th\u00e0nh<\/p>\n<p><a href=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb10.jpg\" rel=\"attachment wp-att-4718\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-4718\" src=\"https:\/\/cloud.z.com\/vn\/wp-content\/uploads\/2018\/05\/lb10.jpg\" alt=\"lb10\" width=\"710\" height=\"258\" \/><\/a><\/p>\n<div style=\"background: #d62825; padding: 10px; font-size: 15px;\"><span style=\"color: #ffffff;\">Thi\u1ebft l\u1eadp ph\u00eda VPS<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>Ph\u01b0\u01a1ng th\u1ee9c truy\u1ec1n t\u1ea3i g\u00f3i c\u1ee7a c\u00e2n b\u1eb1ng t\u1ea3i l\u00e0 ph\u01b0\u01a1ng ph\u00e1p DSR. \u0110\u00e2y l\u00e0 ph\u01b0\u01a1ng ph\u00e1p c\u1ea7n thi\u1ebft \u0111\u1ec3 chuy\u1ec3n c\u00e1c g\u00f3i tin tr\u1ef1c ti\u1ebfp t\u1eeb VPS cho kh\u00e1ch h\u00e0ng v\u00e0 l\u00e0 ph\u01b0\u01a1ng ph\u00e1p c\u1ea7n thi\u1ebft \u0111\u1ec3 thay \u0111\u1ed5i c\u00e1c thi\u1ebft l\u1eadp m\u1ea1ng. Ch\u00fang t\u00f4i s\u1ebd gi\u1ea3i th\u00edch ph\u01b0\u01a1ng ph\u00e1p thi\u1ebft l\u1eadp v\u1edbi CentOS 6.6 \u1edf d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n<p>C\u00f3 hai ph\u01b0\u01a1ng ph\u00e1p \u0111\u1ec3 ti\u1ebfn h\u00e0nh thi\u1ebft l\u1eadp\u00a0iptables v\u00e0 th\u00eam giao di\u1ec7n loopback.<\/p>\n<div style=\"background: #d62825; padding: 10px; font-size: 15px;\"><span style=\"color: #ffffff;\">Ph\u01b0\u01a1ng ph\u00e1p c\u1ea5u h\u00ecnh giao di\u1ec7n Loopback<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>[1] Ch\u1ec9nh s\u1eeda t\u1eadp tin c\u1ea5u h\u00ecnh c\u1ee7a giao di\u1ec7n loopback<\/p>\n<div style=\"background: #f5f5f5; padding: 10px;\">vi \/etc\/sysconfig\/network-scripts\/ifcfg-lo:0<\/div>\n<p>&nbsp;<\/p>\n<p>N\u1ed9i dung c\u1ee7a t\u1eadp tin nh\u01b0 sau:<\/p>\n<div style=\"background: #f5f5f5; padding: 10px;\">DEVICE=lo:0<br \/> IPADDR=[\u0110\u1ecba ch\u1ec9 IP \u1ea3o c\u1ee7a c\u00e2n b\u1eb1ng t\u1ea3i]<br \/> NETMASK=255.255.255.255<br \/> ONBOOT=yes<\/div>\n<p>&nbsp;<\/p>\n<p>[1] Kh\u1edfi \u0111\u1ed9ng l\u1ea1i d\u1ecbch v\u1ee5 m\u1ea1ng \u0111\u1ec3 ph\u1ea3n \u00e1nh c\u00e0i \u0111\u1eb7t<\/p>\n<div style=\"background: #f5f5f5; padding: 10px;\">service network restart<\/div>\n<p>&nbsp;<\/p>\n<div style=\"background: #d62825; padding: 10px; font-size: 15px;\"><span style=\"color: #ffffff;\">Ph\u01b0\u01a1ng ph\u00e1p thi\u1ebft l\u1eadp\u00a0iptables<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>[1] Th\u1ef1c hi\u1ec7n l\u1ec7nh sau<\/p>\n<div style=\"background: #f5f5f5; padding: 10px;\">iptables -t nat -A PREROUTING -d [\u0110\u1ecba ch\u1ec9 IP \u1ea3o c\u1ee7a c\u00e2n b\u1eb1ng t\u1ea3i] -j REDIRECT<\/div>\n<p>&nbsp;<\/p>\n<p>\u0110\u1ec3 l\u01b0u thi\u1ebft l\u1eadp, h\u00e3y vi\u1ebft thi\u1ebft l\u1eadp trong\/etc\/sysconfig\/iptables<\/p>\n<p>[2] Tr\u01b0\u1eddng h\u1ee3p\u00a0CentOS7<\/p>\n<p>V\u00ec CentOS 7 \u0111\u01b0\u1ee3c qu\u1ea3n l\u00fd b\u1edfi firewalld v\u00e0 NetworkManager n\u00ean kh\u00f4ng th\u1ec3 thi\u1ebft l\u1eadp trong iptables. Vui l\u00f2ng tham kh\u1ea3o quy tr\u00ecnh sau \u0111\u00e2y.<\/p>\n<div style=\"background: #f5f5f5; padding: 10px;\"># Th\u00eam d\u1ecbch v\u1ee5 http v\u00e0o firewalld (gi\u1ed1ng nh\u01b0 m\u1edf c\u1ed5ng 80 trong iptables)<br \/> firewall-cmd --add-service http<\/p>\n<p># Th\u00eam \u0111\u1ecba ch\u1ec9 IP c\u1ee7a c\u00e2n b\u1eb1ng t\u1ea3i l\u00e0m b\u00ed danh cho # eth0<br \/> nmcli c mod eth0 + ipv4.addresses \"[\u0110\u1ecba ch\u1ec9 IP \u1ea3o c\u1ee7a c\u00e2n b\u1eb1ng t\u1ea3i]\/32\"<\/p>\n<p># Kh\u1edfi \u0111\u1ed9ng l\u1ea1i giao di\u1ec7n m\u1ea1ng \u0111\u1ec3 ph\u1ea3n \u00e1nh c\u00e0i \u0111\u1eb7t<br \/> nmcli c down eth0; nmcli c up eth0<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>[2] X\u00e1c nh\u1eadn r\u1eb1ng b\u1ea1n c\u00f3 th\u1ec3 truy c\u1eadp b\u00ecnh th\u01b0\u1eddng<\/p>\n<p>Vui l\u00f2ng truy c\u1eadp \u0111\u1ecba ch\u1ec9 IP \u1ea3o c\u1ee7a c\u00e2n b\u1eb1ng t\u1ea3i \u0111\u1ec3 x\u00e1c nh\u1eadn r\u1eb1ng n\u00f3 \u0111\u01b0\u1ee3c t\u1ea3i c\u00e2n b\u1eb1ng \u0111\u00fang c\u00e1ch.<\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>C\u00e2n b\u1eb1ng t\u1ea3i c\u1ee7a Z.com cung c\u1ea5p ch\u1ee9c n\u0103ng ph\u00e2n ph\u1ed1i l\u01b0u l\u01b0\u1ee3ng truy c\u1eadp \u0111\u1ebfn VPS. B\u1ea1n c\u00f3 th\u1ec3 ph\u00e2n ph\u1ed1i t\u1ea3i ho\u1eb7c t\u1ea1o h\u1ec7 th\u1ed1ng d\u1ef1 ph\u00f2ng. Ph\u01b0\u01a1ng th\u1ee9c chuy\u1ec3n g\u00f3i l\u00e0 ph\u01b0\u01a1ng ph\u00e1p DSR. V\u00ec \u0111\u00e2y l\u00e0...<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[209,187],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/posts\/4698"}],"collection":[{"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/comments?post=4698"}],"version-history":[{"count":38,"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/posts\/4698\/revisions"}],"predecessor-version":[{"id":4746,"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/posts\/4698\/revisions\/4746"}],"wp:attachment":[{"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/media?parent=4698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/categories?post=4698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloud.z.com\/vn\/wp-json\/wp\/v2\/tags?post=4698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}