stunnel / Ocserv-install-script-for-CentOS-RHEL-7

Ocserv(AnyConnect Server) install script for CentOS/RHEL 7
283 stars 164 forks source link

执行了脚本,出现 warning #1

Open S1U opened 9 years ago

S1U commented 9 years ago

sh 了脚本文件后,滚了几屏幕,出现提示设置端口、用户名、密码,在接下来有事滚了几屏,就到了下面,

Chenking FirewallD status... WARNING!!! FirewallD is Wrong!

Chenking ocserv service status... ocserv-install-script-for-centos7.sh: line 570: netstat: command not found ocserv-install-script-for-centos7.sh: line 571: netstat: command not found ocserv-install-script-for-centos7.sh: line 572: netstat: command not found WARNING!!! ocserv service is Wrong!

travislee89 commented 9 years ago

应该是firewalld没有装或者没有启动,net-tools工具没有安装。

S1U commented 9 years ago

能不能说下怎么检测 firewall 有没有装或者怎么启动?centos 是在搬瓦工上面直接 new os 的。

On Wed, Dec 17, 2014 at 12:21 AM, Travis Lee notifications@github.com wrote:

应该是firewalld没有装或者没有启动,net-tools工具没有安装。

— Reply to this email directly or view it on GitHub https://github.com/travislee8964/Ocserv-install-script-for-CentOS-RHEL-7/issues/1#issuecomment-67185771 .

travislee89 commented 9 years ago

是 firewalld,CentOS 7 下默认代替 iptables 的防火墙 搬瓦工没有使用过,估计是卸载了 firewalld,改用 iptables 了 iptables 可以用以下命令,需要更改 192.168.8.0/21(ocserv使用的 IP段) 和 eth0(服务器的网卡名称) iptables -t nat -A POSTROUTING -s 192.168.8.0/21 -o eth0 -j MASQUERADE 这个命令重启后会失效,可以用 service iptables save 保存,或者直接更改 /etc/sysconfig/iptables

如果两个防火墙都没有安装,需要安装一个,服务器推荐用 iptables。 安装后需要先配置开启 ssh 的端口,再开启防火墙。