 |
 |
 |
 |
| F17 Development Forum The proper place for all things "F17." This section has been archived since F17 reached final release. |

11th April 2012, 06:18 AM
|
|
Registered User
|
|
Join Date: Jul 2005
Posts: 640

|
|
|
How to open a port in firewalld
Well, I just installed f17 rc3 on a kvm machine, install went well. I am connecting via SSH (no gui) and for the life of me I can't figure how to open a port in firewalld using firewall-cmd
I tried : firewall-cmd --add --zone=public --port=5911:tcp but get back the helpful message "need more than 1 value to unpack"
I know firewalld is active, if I use systemctl stop firewalld.service I can connect fine to the port in question.
Is there any decent documentation anywhere on firewall-cmd? The man page is, shall we say, content-challenged.
__________________
======
Doug G
======
|

11th April 2012, 06:27 AM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,620

|
|
|
Re: How to open a port in firewalld
try
firewall-cmd --enable --port=5911:tcp
|

11th April 2012, 06:40 AM
|
|
Registered User
|
|
Join Date: Jul 2005
Posts: 640

|
|
|
Re: How to open a port in firewalld
After some more fiddling, this syntax seemed to work:
Code:
firewall-cmd --zone=public --add --port=5911/tcp
But this doesn't persist between reboots, I had to re-issue the above to re-open the port after a reboot of the vm. How does one permenantly open a port?
Oh, thanks DBelton, I didn't see your answer until I submitted this
__________________
======
Doug G
======
Last edited by Doug G; 11th April 2012 at 06:42 AM.
|

13th May 2012, 06:54 PM
|
|
Registered User
|
|
Join Date: May 2012
Location: NONEURBIZ
Posts: 1

|
|
|
Re: How to open a port in firewalld
For me --enable didn't work.
$ firewall-cmd --enable --port=24800:tcp
Wrong action and mode combination
$ firewall-cmd --enable --port=24800/tcp
Wrong action and mode combination
But add did
$ sudo firewall-cmd --add --port=24800/tcp
|

19th May 2012, 10:39 PM
|
 |
Registered User
|
|
Join Date: Jan 2010
Location: Elsass
Posts: 17

|
|
|
Re: How to open a port in firewalld
Hi,
Quote:
Originally Posted by raviprak
For me --enable didn't work.
$ firewall-cmd --enable --port=24800:tcp
Wrong action and mode combination
$ firewall-cmd --enable --port=24800/tcp
Wrong action and mode combination
But add did
$ sudo firewall-cmd --add --port=24800/tcp
|
Same results with $ firewall-cmd --enable --port=24800:tcp and $ firewall-cmd --enable --port=24800/tcp.
firewall-cmd --add --port=24800/tcp is working and the port is open but this doesn't persist after reboot too..
-- EDIT --
firewall-cmd --zone=public --add --port=5911/tcp doesn't persist after reboot too.
I did this but I don't know if it's clean : I edit the /usr/lib/firewalld/zones/public.xml file and change it like this
Quote:
<?xml version="1.0" encoding="utf-8"?>
<zone name="public">
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="ssh"/>
<service name="dhcpv6-client"/>
<port port="port nb" protocol="tcp"/>
<port port="port nb" protocol="udp"/>
</zone>
|
The port still be open after reboot.
So, if someone have a much cleaner way to do it would be nice.
Last edited by Raphos; 19th May 2012 at 11:10 PM.
|

21st May 2012, 10:06 PM
|
 |
Fedora QA Community Monkey
|
|
Join Date: Dec 2008
Location: Vancouver, BC
Posts: 3,832

|
|
|
Re: How to open a port in firewalld
it's never clean to edit any file in /usr , as a general rule. I'm afraid I don't know the 'right' way to do it, sorry :/ but any kind of user editable config file will be in /etc, not /usr.
|

21st May 2012, 10:51 PM
|
 |
Registered User
|
|
Join Date: Sep 2009
Posts: 1,409

|
|
|
Re: How to open a port in firewalld
I'd say you want to copy the appropriate file in /usr/lib/firewalld/zones to /etc/firewalld/zones and edit the copy:
Code:
# ll /etc/firewalld/zones
total 0
# ll /usr/lib/firewalld/zones
total 36
-rw-r-----. 1 root root 269 Apr 20 12:33 block.xml
-rw-r-----. 1 root root 304 Apr 20 12:33 dmz.xml
-rw-r-----. 1 root root 238 Apr 20 12:33 drop.xml
-rw-r-----. 1 root root 335 Apr 20 12:33 external.xml
-rw-r-----. 1 root root 412 Apr 20 12:33 home.xml
-rw-r-----. 1 root root 431 Apr 20 12:33 internal.xml
-rw-r-----. 1 root root 329 Apr 20 12:33 public.xml
-rw-r-----. 1 root root 194 Apr 20 12:33 trusted.xml
-rw-r-----. 1 root root 354 Apr 20 12:33 work.xml
dd_wizard
|

22nd May 2012, 06:29 AM
|
 |
Fedora QA Community Monkey
|
|
Join Date: Dec 2008
Location: Vancouver, BC
Posts: 3,832

|
|
|
Re: How to open a port in firewalld
that sounds pretty likely; it's a common design these days.
|

22nd May 2012, 08:57 AM
|
 |
Registered User
|
|
Join Date: Jul 2007
Posts: 371

|
|
|
Re: How to open a port in firewalld
Or, instead of bashing your head against the wall you could uninstall firewalld and install iptables and system-config-firewall (gui tool). That's what I did anyway. Won't be touching firewalld until the gui tool is done.
__________________
these command lines are like casino slot machines, every time I input commands NOTHING HAPPENS
|

22nd May 2012, 07:09 PM
|
 |
Registered User
|
|
Join Date: Sep 2009
Posts: 1,409

|
|
|
Re: How to open a port in firewalld
Quote:
Originally Posted by AdamW
that sounds pretty likely; it's a common design these days.
|
Just out of curiousity, is that level of firewalld administration documented anywhere?
dd_wizard
|

22nd May 2012, 08:03 PM
|
 |
Fedora QA Community Monkey
|
|
Join Date: Dec 2008
Location: Vancouver, BC
Posts: 3,832

|
|
|
Re: How to open a port in firewalld
I have no idea. I voted for comment #9. =)
|

22nd May 2012, 08:17 PM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,620

|
|
|
Re: How to open a port in firewalld
While I agree that iptables is getting a bit long in the tooth and needs a complete overhaul, I won't be putting firewalld on my main box here for quite awhile yet.
I have been testing it out on my other boxes, but until I am certain that it is secure and works properly, it won't go on my main box.
Sorry, but to me, security trumps ease of use in a package like a firewall.
But I do like where firewalld is heading. It looks like it will be a pretty good package once finished (unless they let the gnome developers around it  )
|

22nd May 2012, 08:18 PM
|
 |
Registered User
|
|
Join Date: Sep 2009
Posts: 1,409

|
|
|
Re: How to open a port in firewalld
@AdmW:
dd_wizard
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 12:31 (Wednesday, 19-06-2013)
|
|
 |
 |
 |
 |
|
|