Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ CentOS iptables firewall enabled     - OpenSUSE 13.1 OpenSUSE 12.3 and how to install Cinnamon 2.2 Desktop (Linux)

- Oracle 11g RMAN cross-platform transfer table space (Database)

- To install Docker under CentOS7 (Linux)

- Camouflage Nginx Web server version to prevent invasion (Linux)

- Related to optimize the use of Btrfs file system on SSD (Linux)

- Linux Crontab Timing task command Detailed (Linux)

- Linux-du and df command (Linux)

- Linux system crash (no such file or directory) How to rescue database (Linux)

- Setting up Linux machine through a proxy firewall (Linux)

- Linux operating system security can not be ignored (Linux)

- Getting Started with Linux: Nginx Web Server How to Block Specific User Agents (UA) (Server)

- CentOS and RHEL installation under GAMIT10.6 (Linux)

- PostgreSQL export table structure information (Database)

- Linux package manager - yum (Linux)

- Vim custom color (Linux)

- AngularJS notes --- Data Binding (Programming)

- Java filter (Programming)

- How to modify the Ubuntu terminal user name changed to red color (Linux)

- shell script: a key to install LAMP, LNMP script (Server)

- CentOS install video converter FFmpeg and cutting tools segmenter (Linux)

  CentOS iptables firewall enabled
  Add Date : 2018-11-21      
  CentOS 7.0 before seemingly are using iptables firewall, and after 7.0 is firewall, in fact, I do not know as well, but most people are using iptables, so I have to use it.

First, turn off firewall

1 // Stop firewall
2 sudo systemctl stop firewalld.service
3 // Disable firewall boot
4 sudo systemctl disable firewalld.service

Second, of course, is to install a firewall iptables

1. Install

1 // Installation
2 sudo yum install iptables-services


// Edit iptables, use sudo if the authority is not enough to open
vi / etc / sysconfig / iptables
//document content
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
* Filter
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
//save document
C + C and then: wq exit -> Due emacs diet where C represents Ctrl, so C + C is actually Ctrl + C, so the basic will write later, more convenient.
// Restart the firewall configuration to take effect
sudo systemctl restart iptables.service
// Set up a firewall boot
sudo systemctl enable iptables.service

OK, then, your iptables already configured, if you later want to add a port, then read on.

3. Open Ports

// * Asked replaced inside the port number you want to open
/ Sbin / iptables -I INPUT -p tcp --dport * -j ACCEPT
// Save the configuration
/etc/rc.d/init.d/iptables save
// Check iptables after you change
/etc/init.d/iptables status
// Restart iptables
sudo service iptables restart

Well, these are some of the basic configuration of iptables, there are super-tough stuff, I hope you can tell me about.
- KVM installation under CentOS 5.5 (Linux)
- Python format string (Programming)
- Ubuntu use three methods to install Ruby (Linux)
- See how --nand flash timing diagram of a read operation Comments (Programming)
- Linux users should be aware that should the 7 ls command unique skills (Linux)
- RedHat Linux 5.5 installation process SVN Service Notes (Server)
- How to configure security management services under Linux (Linux)
- How to Install Foreman under Ubuntu (Server)
- CentOS 6.x Basic System Optimization after installation (Linux)
- Linux Services Comments (Linux)
- Close and limit unused ports computer server security protection (Linux)
- CentOS 6.4 install and configure Squid Proxy Server (Linux)
- A new method for Linux hidden files (Linux)
- How to create a binary distribution with Bash (Linux)
- Why HBase need to build SQL engine layer (Database)
- MongoDB 3.0 New Features (Database)
- How to Start a Linux application running in the background using the terminal mode (Linux)
- Python programmers most often committed ten errors (Programming)
- How to install and use the malware detection tool LMD and ClamAV antivirus engine on Linux (Linux)
- Linux package manager - yum (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.