Author Topic: [SOLVED] Urgent Help - How to modify firewall redirection rule  (Read 5045 times)

ram

  • Zen Apprentice
  • *
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Hi,

 ??? I need an urgent help from anyone re this:

I accidentally set my firewall redirection rule to accept all ports to one single port.

As a result, my web server, ssh, 443 ports are all now being reidrected to that single port :(

How do I delete or change this rule under the CLI?

Many thanks for any assistance!

- Ram
« Last Edit: July 13, 2010, 04:13:19 am by ram »
-----------------
Best Regards,
Ram ;)

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
Re: Urgent Help - How to modify firewall redirection rule
« Reply #1 on: August 17, 2009, 10:46:23 am »
You can disable the firewall with this command:
/etc/init.d/firewall stop

Then you can enter in the web interface, fix your firewall settings and save changes.

ram

  • Zen Apprentice
  • *
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Urgent Help - How to modify firewall redirection rule
« Reply #2 on: August 17, 2009, 02:38:04 pm »
Hi Javier,

Your reply is much appreciated as always  :)

I did see that solution on another thread but was kinda afraid to try it out just in case it stuffs somethings up upon re-booting or something.

As this ebox is a production one and was actively used today by various departments and being a monday, I was looking for another for-sure/failsafe solution.

I managed to fix up this error by doing the following below. This could assist anyone else who got into trouble like me today.

-------------------
In case anyone wants to know where eBox firewall rules are set,
go to

/var/lib/ebox/gconf/ebox/modules/firewall

Here you would see all the folders that points to the various sections of firewall within the ebox web interface such as

- ExternalToInternalRuleTable
- RedirectsTable
- .....

Under these folders you would see folders called 'keys'

All the rules are set here under different sub-folders.

I am not entirely sure on how all these are interconnected but if you want to disable a particular rule,
I would suggest either modifying the corresponding *.xml file
or
copy and paste the content of another working *.xml file and change the details slightly (maybe just 1 or 2 numbers of IP address/ports),
re-start ebox via command line, then login back to web interface and delete or edit this slightly modified rule.

It worked for me and  :o I got everything back to normal!

If anyone else thinks this is wrong please advise accordingly incase others follow this blindly and get into further trouble.

Javier, I will try that firewall stop method on my test box to ensure it works as this way is definetly easier!

Thanks again Javier!

-------------------
-----------------
Best Regards,
Ram ;)