Ocserv-install-script-for-CentOS-RHEL-7 icon indicating copy to clipboard operation
Ocserv-install-script-for-CentOS-RHEL-7 copied to clipboard

执行了脚本,出现 warning

Open s1u opened this issue 10 years ago • 3 comments

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!

s1u avatar Dec 15 '14 12:12 s1u

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

travislee89 avatar Dec 16 '14 16:12 travislee89

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

On Wed, Dec 17, 2014 at 12:21 AM, Travis Lee [email protected] 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 .

s1u avatar Dec 17 '14 02:12 s1u

是 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 的端口,再开启防火墙。

travislee89 avatar Dec 17 '14 03:12 travislee89