Configure with/etc/sysconfig/iptables-A input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT (allow 80 ports through the firewall)-A input-m state–state new-m tcp-p tcp–dport 3306-j ACCEPT (Allow 3306 ports through the firewall)(22 ports are added by default when the system is loaded and other ports can be configured in their format)Special Note: Many netizens add these two rules to the last line of the
In the previous installment and use example of the Iptables firewall Configuration tool Shorewall, we described how to install and use the Shorewall tool for firewall configuration, and in this article we will give you an example of some of its advanced components.
Introduction of Advanced Components
1, params
This
It is necessary to configure the Iptables firewall under CentOS. Let's learn how to configure!
Set up firewalls in Linux, take CentOS as an example, and open the Iptables configuration file:
Default
Vi/etc/sysconfig/iptablesQuery for open 80 ports through the/etc/init.d/iptables status command if there are no two ways to handle:
1. Modify the Vi/etc/sysconfig/iptables command to add the
configuration GatewaySecurity-level 0 Configuring the interface's security level (range is 0-100)Interface G2 Entry PortNameif name of the DMZ configuration interfaceIP address 192.168.30.254 255..255.255.0 configuration GatewaySecurity-level 50 Configuring the interface's security level (range is 0-100)Write an ACL so that Client2 can access Server3Access list
use squid as a Web transparent proxy server.[[Email protected]]# echo 1 >/proc/sys/net/ipv4/ip_forward[[Email protected]lhost]# iptables-t nat-a prerouting-s 192.168.138.0/24-p tcp--dport 80-i eth0-j DNAT--to 192.168 .138.1[[Email protected]]# iptables-t nat-a prerouting-s 192.168.138.0/24-p tcp--dport 80-i eth0-j REDIRECT--to 3128[Email protected]]# iptables-t nat-a postrouting-o ppp0-j MasqueradeNote: The iptables write rule restart is automatically invalidated and needs to be saved to a file
segment is not blocked.
Bantime = 600 plugging time, in seconds
Maxretry = 3 people think this configuration is a bit misleading. It is actually the number of times that the log filtered out by the filter (as described later) needs to be blocked according to the rule.
We use the default [ssh] service to introduce the configuration of a service:
Enabled = true: whether to enable or not.
Port = ssh block por
IP/MAC Binding RequirementsThe MAC address and IP address binding, can prevent IP address spoofing network attack, IP spoofing attack attempts to use a trusted computer's IP address from different computers to connect and through the firewall, IP address can be easily changed, but the MAC address is in the factory production is added to the Ethernet card, it is difficult to change, A trusted host can avoid fraudulent connections by registering both t
All operations on this computer are normal after the MySQL server is installed, but the MySQL server is not connected remotely on other machines. shit!Suspect is a port problem, the result:Telnet 192.168.1.245 3306The connection was not found, so the port was restricted by the firewall.Now all you have to do is open port 3306 in the firewall.Execution Vi/etc/sysconfig/iptables:-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPTT
CommandControl
Firewall. When using firewall disable
CommandClose
Firewall,
FirewallThe statistics will also be cleared.
[Example]
Enable
Firewall.
Quidway (config) # firewall enable
[Related
Command]
Access-list, ip access-group
Iv.
Firewall commandService Iptables stop--stopService iptables Start--StartFile/etc/sysconfig/ iptables# Firewall configuration written by System-config-firewall# Manual Customization of this file was not recommended.*filter:input accept [0:0]:forward Accept [0:0]:output accept [0:0] -A input-m state--state established,re
There are many things worth learning about broadband ADSL cat firewall. Here we mainly introduce the configuration of broadband ADSL cat firewall. Today is an era where hackers are common. If you stay at your home and access the Internet, you may be shot. Attacking you from time to time will make your head big. Fortunately, many broadband ADSL cats have built-in
system, and you need to set up the system to automatically start Portmap and NFS services at the specified run level.
#chkconfig--list Portmap
#chkconfig--list NFS
Set up Portmap and NFS services to start automatically at System run level 3 and 5.
#chkconfig--level Portmap on
#chkconfig--level NFS On
6. Server-side uses the Showmount command to query NFS for shared status
#showmount –e///default view of their shared services, the premise is to DNS can resolve their own, or easily error
#showmo
Firewall-based Easy VPN configuration process
Objective: To enable a client on the remote Internet to access internal resources of the LAN through an encrypted tunnel by making Easy VPN on the gateway ASA firewall device.The following figure shows the experiment topology. R1 is a router inside the lan. C1 connects to the VMnet1 Nic and uses the Windows 7 operatin
First, firewall configuration# Vi/etc/sysconfig/iptablesThe following firewall rule file example (the red part is the content that needs to be changed)///////////////////////////////////////////////////////////////////////////////////////////////////# Firewall configuration
Layer-3 egress connection to the internal port of the firewall
It is recommended that layer-3 core switches use VLAN1 to connect to the firewall's internal port. The Intranet access to the Internet may be slow due to IP redirection !!
The specific examples and solutions are as follows:
The core of a certain Enterprise Network is 4506, And the access is basically 2950 series. The core is an X 4548 GB nbs p;-RJ Business Board, with 48 ports uplinked to
Permanent, no recovery after rebootChkconfig iptables onChkconfig iptables offImmediate effect, recovery after rebootService Iptables StartService Iptables StopIt should be stated that for other services under Linux, the above command can be used to perform the open and close operations.When the firewall is turned on, make the following settings, open the relevant port,Modify the/etc/sysconfig/iptables file to add the following:-A rh-
To view the status of a firewall:/etc/init.d/iptables status or service iptables status1) temporary entry into force, recovery after restartOpen: Service iptables startOFF: Service iptables stop or/etc/init.d/iptables stopRestart:/etc/init.d/iptables restart2) Permanent, no recovery after rebootOpen: Chkconfig iptables onOFF: Chkconfig iptables offWhen the firewall is turned on, make the following settings
CentOS Linux firewall configuration and shutdown
Firewall shutdown, turn off its services:
To view firewall information:#/etc/init.d/iptables status
To turn off the Firewall service:#/etc/init.d/iptables stop
Permanently closed. Do not know how a permanent method:#chkconfig
Author: doublelee
Date: 2005-6-1
Tiannet firewall version 2.50 is compiled using Borland C and the rule configuration file is encrypted. To bypass its monitoring, you must be able to read and write its rule configuration file and restart it.This article mainly describes how to read and write the configuration file. By
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.