Sequence 1:Configuring a basic IPv4 Firewall
Instructions:
1. Use ssh to connect to serverX and become root:
2. Create a custom chain called CLASS-RULES and insert a rule at the top of INPUT that jumps all packets to it. Save the firewall configuration when you are done.
iptables -N CLASS-RULES
iptables -A INPUT -j CLASS-RULES
3.Populate the CLASS-RULES chain by editing /etc/sysconfig/iptables directly.Add rules that do the following:
ACCEPT all traffic arriving on the loopback interface(lo)
ACCEPT packets that use the icmp protocol
ACCEPT packets with the ESTABLISHED or RELATED state
HINT: you will need to load the state module to create this and similar rules.
ACCEPT packets desined for tcp port 22 ssh
ACCEPT packets with the NEW state destined for udp port 514
LOG and REJECT all packets not matched by one of the above rules
HINT you will need two rules to do this.
Do not load the new rules yet.
-A INPUT -j CLASS-RULES
-A CLASS-RULES -i lo -j ACCEPT
-A CLASS-RULES -p icmp -j ACCEPT
-A CLASS-RULES -m state --state ESTABLISHED,RELATED -j ACCEPT
-A CLASS-RULES -p tcp --dport 22 -j ACCEPT
-A CLASS-RULES -m state --state NEW -p udp --dport 514 -j ACCEPT
-A CLASS-RULES -j LOG
-A CLASS-RULES -j REJECT
4. Load your new rules.
server iptables restart
re-instate a basic CLASS-RULES chain by doing the following
a use xm console vserver to open a terminal to server x virtual machine
b disable the firewall by running service iptables stop
c use the following command to retrieve the reset-firewall script to your home directory
wget -p ~ ftp://server1/pub/gls/scripts/reset-firewall
d execute the sctipt by running ~/reset-firewall. This should create a basic firewall that allows ssh access. any other rules necessary for the lab will need to be added manually
RH 253 Lab4:Securing Networking
原创Cisco1841sw ©著作权
©著作权归作者所有:来自51CTO博客作者Cisco1841sw的原创作品,请联系作者获取转载授权,否则将追究法律责任
![](https://ucenter.51cto.com/images/noavatar_middle.gif)
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
switch分解试验部分-LAB4:VLAN VTP设置
switch分解试验部分-LAB4:VLAN VTP设置
VLAN VTP 试验 switch 分解 -
OSPF分解试验部分-LAB4:配置OSPF多区域
OSPF分解试验部分-LAB4:配置OSPF多区域
OSPF 试验 休闲 区域 分解 -
RH033 RH133 RH253 实验报告
好不容易在网上找到RHCE相关的资料,特发出来和大家一起分享
职场 休闲 RHCE实验报告 -
RH253学习资料下载
RH253相关学习资料
linux 职场 休闲 RHCE -
RH253 第二章
SELinux ,xinetd
职场 生活 休闲 RH253 第二章 -
CS144 lab4 计算机网络实验 笔记
CS144 lab4 计算
网络 udp http TCP ci