-1

I have openSUSE 11.3 installed. I'm using the openSUSE firewall configuration mechanism (/etc/sysconfig/SuSEfirewall2). I have a http server application running on port 8080. I want the http service to be accessible using port 80. I created a redirect rule usign:

FW_REDIRECT="0/0,0/0,tcp,80,8080"

This works fine for every request coming from external. But it doesn't for local requests. (example: wget http://myserver/)

Is there a way how I can tell the firewall to redirect local requests addressed for 80 to port 8080? (using the SUSE firewall configuration file)

Nils
  • 7,695
  • 3
  • 34
  • 73
Eduard Wirch
  • 352
  • 4
  • 14

2 Answers2

0

Not that I'm aware of. The openSUSE firewall doesn't get invoked when coming from 'inside' as it were.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • The firewall will be `iptables` based though and it's definitely capable of applying rules 'inside'. If you can't configure it via SuSefirewall then you could add them manually. – Matt Mar 12 '14 at 11:37
0

I'm not a SuSe user so I can't speak for it's firewall config, going by sysadmin1138's answer I assume SuSe might be specifying an interface for the redirect you are adding or only adding the redirect to the FORWARD NAT table which local traffic does not traverse.

To see what SuSe has configured:

sudo iptables -t nat -vnL

To apply the redirect for local traffic from any interface with iptables:

sudo iptables -t nat -A OUTPUT --protocol tcp --destination YO.UR.IP.AD --dport 80 -j REDIRECT --to-port 8080

You would then need to persist this with your SuSe firewall setup or figure out the equivalent SuSe config.

Matt
  • 1,559
  • 8
  • 11