I am setting up an Azure Suse v13 linux VM, and
by default the only port open is ssh (22)
I have root access. Please advise proper command/shell
to add the TCP ports I need open thru the firewall.
Note: I cannot run YaST because I do not have interactive access with desktop.
I have configured the Azure “endpoints”, but next need to open
the ports thru firewall.
You can use YaST in text mode as well, provided the necessary packages are installed of course.
I have configured the Azure “endpoints”, but next need to open
the ports thru firewall.
So how is the firewall set up in the first place?
If you are using the standard SuSEfirewall, have a loot at /etc/sysconfig/SuSEfirewall2, in particular the variables “FW_SERVICES_EXT_TCP” and “FW_SERVICES_EXT_UDP” if you want to open it for the external zone. (or correspondingly “FW_SERVICES_DMZ_xxx” and “FW_SERVICES_INT_xxx” for the DMZ or internal zone)
You can of course use “iptables” directly as well (see any tutorial about that), but you would have to make that run on boot.
Preferably your rules should be integrated to the rules that are set up already anyway though. How you would do this depends on how the existing firewall is set up in the first place.
In the configuration file variables I mentioned (in /etc/sysconfig/SuSEfirewall2) you can specify the ports directly (as numbers).
The service files you listed are there to be able to just select a service in YaST->Security and Users->Firewall from the dropdown list instead of having to specify the ports manually.
You could of course put a file in there for your own service then you’ll see it in YaST. But your original question was how to do it without YaST, no?
Currently, the file
/etc/sysconfig/SuSEfirewall2
does not exist.
The directory
/etc/sysconfig/SuSEfirewall2.d exists and has those
text files in there.
Thus, should I simply copy the text file
/etc/sysconfig/SuSEfirewall2
from another system and enter the port values
you mentioned ?
Example for port 8080:
Which TCP services on the firewall should be accessible from
untrusted networks?
Format: space separated list of ports, port ranges or well known
It should.
If it doesn’t exist then probably SuSEfirewall is not used/installed at all.
You should be able to install it with YaST or zypper, that should also create that file.
But if it is not installed, are you sure that there’s even a firewall set up?
The directory
/etc/sysconfig/SuSEfirewall2.d exists and has those
text files in there.
Those are installed by other packages like apache2 or samba to make it easy to open the corresponding ports in YaST.
Thus, should I simply copy the text file
/etc/sysconfig/SuSEfirewall2
from another system and enter the port values
you mentioned ?
Probably, if you use SuSEfirewall2. But then you should have an empty template in /var/adm/fillup-templates/sysconfig.SuSEfirewall2, so just copy that over. Or use YaST to configure it as already mentioned.
If not, again, you have to set iptables rules yourself.
But as I said, if there’s another firewall set up already, it’s probably better the change its configuration than to setup some iptables rules yourself.
Could you maybe post a link to that Appliance you are using (I suppose you downloaded it from somewhere), so somebody can have a look?
I have no idea what packages are installed in an “Azure Suse v13 linux VM”.
Or do you mean you run a standard openSUSE 13.x as VM using Microsoft Azure?
Then SuSEfirewall2 should be installed/running by default.
Please post the output of “systemctl status SuSEfirewall2” to see whether SuSEfirewall2 is installed/running.
On 2014-10-14 19:16, qawtbh wrote:
>
> wolfi323;2669389 Wrote:
>> If you are using the standard SuSEfirewall, have a loot at
>> /etc/sysconfig/SuSEfirewall2, in particular the variables
>> “FW_SERVICES_EXT_TCP” and “FW_SERVICES_EXT_UDP” if you want to open it
>> for the external zone. (or correspondingly “FW_SERVICES_DMZ_xxx” and
>> “FW_SERVICES_INT_xxx” for the DMZ or internal zone)
> So my question is what text file do I add to list the TCP ports you
> mentioned??
No.
YOU edit the file “/etc/sysconfig/SuSEfirewall2” and add there your
changes. Example: