0

I just build centos7, and tried to setup firewalld, when I type command

firewall-cmd --zone=internal --change-interface=eth0

I got error : Error: COMMAND_FAILED

I already start it by

systemctl start firewalld.service 

and firewall-cmd --state it's running

I don't know why ? and I can't find how to solve it ...
is there anything wrong with this centos version or do I miss something??

I don't see any command before , related this firewalld setup error, list all:

yum update

update gcc

yum install centos-release-scl
yum install devtoolset-3-toolchain
scl enable devtoolset-3 bash

install nginx

yum install epel-release
yum install nginx
systemctl start nginx
systemctl enable nginx

install postgres

yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
yum install postgresql95-server postgresql95
/usr/pgsql-9.5/bin/postgresql95-setup initdb
systemctl start postgresql-9.5.service
systemctl enable postgresql-9.5.service

install mongodb

...

install nodejs

...

firewalld

systemctl start firewalld.service
systemctl enable firewalld.service

firewall-cmd --zone=internal --change-interface=eth0

UPDATE

after I tried firewald reload , I can't use ssh connect now,

ssh: connect to host ... port 22: Connection refused

how to connect and fix firewalld ??

user1775888
  • 147
  • 1
  • 4
  • 13

2 Answers2

0

To reconnect to your server, you can go to "Remote Access" tab on your linode machine, and go to "Launch Lish Console",

Please check this issue looks similar to yours, as linode's kernel mismatch the firewall required modules,

MohammedSimba
  • 369
  • 2
  • 4
  • 15
  • thanks for reply I login success, stop and disable firewalld. I read that post before, and I tried `yum install kernel` it shows already installed, nothing happen, still same error ... – user1775888 Dec 24 '16 at 20:33
0

You have a few questions to answer. Seems like you followed a tutorial and did not get everything right.

  • Are you sure the name of your interface is eth0 . Find out.
  • As suggested go to Linode's Networking tab in the management portal and launch lish for remote access. This is like KVM so even if you an't SSH you can directly access the terminal.
  • unless you specify --permanent parameter to your firewall-cmd it is not really permanent. Restarting the firewall will reset to original defaults.
  • Check your existing rules with firewall-cmd --list-all-zones Some basic ports are unblocked usually
  • optionally alias the firewall-cmd to something short. Looks like you will be using a lot of it :)
Abhishek Dujari
  • 567
  • 2
  • 5
  • 17
  • Thanks for reply, - I tried find out eth0, it is. - I login via lish, stop and disable firewalld, then I can use ssh login now. - I still don't know why got error, I paste all command I type in question, and it's new disk (I also tried rebuld and do it again, got same result) . The weird thing is I did this couple month ago in another I canceled linode account, and it works. – user1775888 Dec 24 '16 at 20:42