Enable port in Centos Linux-solve the problem that the Centos publishing service cannot be accessed through the Internet

Source: Internet
Author: User
CentosLinux open port-solve Centos publish service internet access problems -------------- view server port status -------------------- [root @ zjxl-2etc] etcinitdiptablesstatusTable: filterChainI Centos Linux enable port-solve the problem that Centos publishing service cannot access the Internet # ---------------- view the server port status ------------------ [root @ zjxl-2 etc] #/etc/init. d/iptables status Table: filter Chain INPUT (policy DROP) num target prot opt source destination 1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 2 ACCEPT icmp- -0.0.0.0/0 0.0.0.0/0 3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 22 4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports :30, 80,110,443,330 0: 3500,5700: 6100,7001, 8000: 13000 5 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED, ESTABLISHED Chain FORWARD (policy ACCEPT) num target prot opt source destination OUTPUT Chain (policy ACCEPT) num target prot opt source destination #------------------------ ---- Port 6379 and Port 6380 were not enabled ------------------------------ # enabled Port 6379 hosts [root @ zjxl-2 etc] #/sbin/iptables-I INPUT-p tcp -- dport 6379-j ACCEPT [root @ zjxl-2 etc] #/etc/init. d/iptables status Table: filter Chain INPUT (policy DROP) num target prot opt source destination 1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 6379 2 ACCEPT all -- 0.0. 0.0/0 0.0.0.0/0 3 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 22 5 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports, 80,110,443,330 0: 3500,5700: 6100,7001, 8000: 13000 6 ACCEPT all -- 0.0.0.0.0/0 0.0.0.0/0 state RELATED, ESTABLISHED Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destina Tion # configure enable Port 6380 hosts [root @ zjxl-2 etc] #/sbin/iptables-I INPUT-p tcp -- dport 6380-j ACCEPT # -------------------------- view server port status ----------------------- [root @ the zjxl-2 etc] #/etc/init. d/iptables status Table: filter Chain INPUT (policy DROP) num target prot opt source destination 1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 6380 2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 6379 3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 4 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 5 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt: 22 6 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports, 80,110,443,330 0: 3500,5700: 6100,7001, 8000: 13000 7 ACCEPT all -- 0.0.0.0.0/0 0.0.0.0/0 state RELATED, ESTABLISHED Chain FORWARD (policy ACCEPT) num target prot opt source desti Nation Chain OUTPUT (policy ACCEPT) num target prot opt source destination # ---------------------------------- save modification configuration ------------------------------- [root @ zjxl-2 etc] #/etc/rc. d/init. d/iptables save Saving firewall rules to/etc/sysconfig/iptables: [OK] [root @ zjxl-2 etc] # Problem description: After the Redis Cache service is installed on the Centos server, the connection times out when other machines cannot be accessed ., Depressed, find a solution on the Internet: /sbin/iptables-I input-p tcp -- dport 6379-j ACCEPT/sbin/iptables-I INPUT-p tcp -- dport 6380-j ACCEPT and then save:/etc/rc. d/init. d/iptables save. after the computer is restarted, the CentOS firewall opens ports 6379 and 6380 by default. You may not restart the computer either here:/etc/init. d/iptables restart view CentOS firewall information:/etc/init. d/iptables status disable the CentOS firewall service:/etc/init. d/iptables stop: chkconfig-level 35 iptables off

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.