add a special rule to SuSEfirewall2

Hello,

I manage a gateway between a meeting room and the net (12.1 server). This gateway also hold a virtual machine with our LUG server (Le site web du CULTe - Main - HomePage).

With the standard config we can’t acces the http server (apache) from the inside of the network. I wonder what is the best way to make the server available during the meetings :-).

One of the LUG members wrote an iptable rule for the gateway that works:


iptables -t nat -A PREROUTING -i eth6 -d 82.234.76.241 -p tcp --dport  80 -j DNAT --to 192.168.56.2 


I barely understand it :-(.

I can add this to a boot.local script or similar, like the SuSEfirewall script itself, but wonder what is the best fitting thing to make this in SuSEfirewall2 (I don’t want to break any security thing).

any idea welcome
thanks
jdd

There are two possible reasons why an Internet resource sitting on your edge may not be visible to your internal networks.

  1. Networking. Typically a machine sitting on your edge which would be accessible to both internal and external clients should be configured in your DMZ, not external zone… But either way can be made to work. If your websites are database driven with the databases residing in your LAN, then you <must> deploy your webservers in the DMZ or expose your databases directly to external attacks. If your webserver is sitting on your edge whether as a VM or directly on hardware, then you’ll have to consider how your webserver/websites are configured… With only external or both internal and external addresses. If you configure only external addresses then you’ll need to test whether “hairpin routing” will work on your machine (External interface accessible through the machine’s internal interface). Some machines can do that, others can’t. Alternative is to configure both external and internal IP addresses for each resource to be accessed from external and internal networks.

  2. Name Resolution. This relates of course to how you configured networking and whether you’re using external addresses only or combination internal and external addresses. If using only external addresses, make sure you don’t have a split DNS setup (same domain name internal and external) which could prevent your internal Users from obtaining Domain addresses from a public DNS. On the other hand, particularly if you configured both internal and external addresses for each resource, make sure each DNS is accessed and serves the proper records. Or, avoid the whole split DNS issue altogether and make sure everyone knows the internal name of a resource is different than the same resource accessed externally.

As for configuring SUSE Firewall, I’m pretty sure you should be able to configure anything you need from within YAST which should avoid various mistakes and organize your configuration better. If you ultimately need a really fancy firewall configuration, other configuration tools exist in the openSUSE repos (but should be considered only rarely).

As always, remember you may need to configure the firewall in your VM as well as on the Host.

HTH,
TSU

On 2012-12-05 14:16, jdd wrote:
> I can add this to a boot.local script or similar, like the SuSEfirewall
> script itself, but wonder what is the best fitting thing to make this in
> SuSEfirewall2 (I don’t want to break any security thing).

There is a custom file where you add your own rules.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Specifically:

Edit the file /etc/sysconfig/SuSEfirewall2

There should be a line with the key FW_CUSTOMRULES. Set this to read:

FW_CUSTOMRULES=”/etc/sysconfig/scripts/SuSEfirewall2-custom”

Create that file and do what you should in there.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJQv36/AAoJEF+XTK08PnB5cfgQAMCcH5DBe6mDRaTdMcfSai3h
VIKdwDk0cP8BK1+A4Oxt9YB7GgRLC/dB9goykZ53Cpfq30MgB4tjT9sfn8JsSYjS
sEUdIHsT6K25tcPfx68Q1qNI+cyEplR5px5x6GGJmfLRxtWrIp0Qw4P8SQmsztXO
iiT5Ccl7DcTT8DlMf0Mnh6W9Ic6OzhlcfwNeCZ3nKO0dfq5AiojlPrbDFuYbQ7pw
ogXnRwi63Zb584q0T7pAtDj+1EQyYj19Ao42ciab1M469qIj/JAiB5S8Oj3WAEwC
GmeVIogu9wd76A2yaKK4ZQkbFY9uAOm98Y/EHeJaVqiWVoEnq/dVXoxf/EMySTr8
kK0GUhLyzOHK8pKBgYwygKCX/QoQ8i/VXpohvKodrTQMFc+566+5D6xnOWOAQMdG
UphytZEnvqAUSnTYkAEV3CNNmvSV+kg8HhwHuWFE40ib3oDGM63h4LSHBaCyXOD6
Y4dDNmZE/Hx96RJupbBgfN8uTEpf2xi/8p7huXX9GHMgwFreImiqi385MEYFmnEK
m+EBwDC07BeQT+882fQmAxJMDR4Vim8lt5ISFfVHFDqg9UjOkXbPt1m25w/6Vqf8
EoVtFskWd92HFtJYPCaDnr6BBA9FVpphCDkYcjSS0lSTqJyTXDwrRG6KFfmKn14O
HykJjiHCyXNq8WimTTuH
=hDGt
-----END PGP SIGNATURE-----

somewhere around /etc/sysconfig/SuSEfirewall2.d/services/?

thanks
jdd

On 12/5/2012 11:56 AM, jdd wrote:
>
> robin_listas;2508719 Wrote:
>>
>>
>> There is a custom file where you add your own rules.
>>
>> –
>> Cheers / Saludos,
>>
>> Carlos E. R.
>> (from 12.1 x86_64 “Asparagus” at Telcontar)
>
> somewhere around /etc/sysconfig/SuSEfirewall2.d/services/?
>
> thanks
> jdd
>
>
jdd;

An example script is at:

/etc/sysconfig/scripts/SuSEfirewall2-custom

This file contains the sum total of documentation on custom rules for
SusEfirewall2. See also: YaST > System >/etc/sysconfig Editor> Network >
Firewall > SuSEfirewall2

P.V.
“We’re all in this together, I’m pulling for you” Red Green

very nice, thanks!!

jdd