1. install the software package
Use the ISO image in the virtual machine to install the corresponding software package
Rpm-q iptables (check whether this service is installed)
Ii. Start the linux Firewall
Service Startup Script:/etc/rc. d/sysconfig/iptables [srat/stop/retsart]
Service iptables restart
# System-config-securitylevel-tui (Firewall Configuration tool)
Iii. Related Documents
(1) configuration file:/etc/sysconfig/iptables-config
(2) side configuration file:/etc/sysconfig/iptablses (this file does not exist in the original system. You need to create a package for filtering and save the firewall policy, save the Command service iptables save service iptablse restart)
Iv. Operation object
(1) rule table: composed of Rule chains
Fileter (default): Packet Filtering
Nat: Address Translation
Mangles: Policy Routing
(2) Rule chain: composed of rules
(3) rule: the most basic setting item, used to Set firewall policies
5. iptables syntax Overview
BASIC script: iptabales-F (clear all packet filtering rules)
Iptablse-X (clear all data links)
Iptables-Z (counters are cleared)
Iptalbes-a input-I eth0-p tcp -- dport 80-j ACCEPT allows external machines to access the web of the server
Iptables-a input-I eht0-p tcp -- dport 22-j ACCEPT enable SSH access
Service iptablse save
Service iptabalse restart