IPTABLES
Red Hat Linux 9 includes
iptables 1.2.7a-2
Red Hat Enterprise Linux 3 incudes
To start the iptables service:
# service iptables start
To automatically start
iptables when the system boots to run-levels 2,3,4 or 5, type:
# chkconfig iptables --level 2345 on
To check the iptables startup configuration
# chkconfig iptables --list
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#
This shows that iptables is configured to automatically start in run-levels
2,3,4 and 5.
To enable IP Forwarding "routing" on the server:
#
# head /etc/sysctl.conf "head"
prints out the first 10 lines of a file:
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet
forwarding
net.ipv4.ip_forward = 0
# Controls source
route verification
net.ipv4.conf.default.rp_filter = 1
#
Notice line #7... net.ipv4.ip_forward = 0
Edit the file using vi or some other text editor, and just change the
0 to a 1,
(0 = no, 1 = yes) and save the file.
#
IP Forwarding "routing" will now take effect on the next system reboot.
In addition, if you want to force it into action sooner, simple type
# echo 1 <
#
To enable NAT (Network
Address Translation) on the "router":
# cp -p /etc/sysconfig//iptables /etc/sysconfig/iptables.orig
#
# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MASQUERADE
#
# service iptables save
Saving current rules to /etc/sysconfig/iptables: [
OK ]
#
service: port:
telnet 23
SMTP (email) 25
DNS 53
HTTP (www) 80
NTP (time) 123
SWAT (samba) 901