如何在CentOS kickstart中结合防火墙–enabled和–nobase?

作为系统强化的一部分,我正在尝试使用以下行在CentOS 6.6 kickstart期间配置我的防火墙.它在一种情况下工作,否则就不工作.

Kickstart防火墙

firewall --enabled 
         --service=ssh --service=http --service=https
         --port=53:udp,69:udp,25150:tcp,25151:tcp,3306:tcp

这告诉它启用防火墙,并打开一组特定的服务.换行是为了便于阅读,而不是配置的一部分.

我的包裹部分如下,请注意:
如果我添加–nobase选项,iptables处于直通模式,没有配置跟踪.

一旦我删除–nobase,iptables就会正确设置,只有一组已定义的开放端口.

Kickstart套餐:

#%packages --nobase --excludedocs
%packages --excludedocs
@core
yum
wget
openssh-server
yum-downloadonly
screen
sysstat
lsscsi
ntpdate
rudder-agent
-nano
-selinux-policy
-selinux-policy-targeted

我做了很多重新安装来跟踪它,并通过谷歌搜索发现有很多人结合–nobase和防火墙 – 启用 – 端口设置.

另外,fyi:将iptables添加到包列表并没有产生差异. – 它是自动添加的.

如果您想知道,最终应用程序的SW供应商不允许启用SELinux.

防火墙输出1

这是添加base时的输出:

[host]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:domain 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:tftp 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:25150 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:25151 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:mysql 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

防火墙输出2

这是我用的时候–nobase:

[host]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

题:

>我不知道其他人是否只是没有检查,或者这是一个特定的错误
CentOS 6.6或确切的触发参数是什么.
> @base中的哪些软件包似乎与安装过程中的iptables配置有关?

是的,基本上,我只想满足那个缺失的依赖.如果没有办法找到它,我会把iptables配置置于操作系统安装之外的东西的控制之下.
我想避免这种情况,以便防火墙配置在首次启动时就位,并由默认机制生成,而不是一些插件.

您需要添加system-config-firewall-base软件包,该软件包提供用于在kickstart期间配置防火墙的lokkit命令.

6.6之前版本的RHEL / CentOS自动包含此软件包,有关该问题的讨论,请参阅https://bugs.centos.org/view.php?id=7956https://bugzilla.redhat.com/show_bug.cgi?id=1161682.

相关文章

文章浏览阅读903次。4.清除缓存目录(/var/cache/yum)下的软件...
文章浏览阅读1.5k次。Python 是一种高级解释性编程语言,已被...
文章浏览阅读2.6k次。打开终端或控制台,以root或具有sudo权...
文章浏览阅读744次,点赞24次,收藏26次。目标:通过AppSrv为...
文章浏览阅读1.1w次,点赞8次,收藏26次。chmod命令来自于英...
文章浏览阅读1.2k次。yum源的URL地址,本例中是文件系统的路...