Koozali.org: home of the SME Server

NAT file configuration

Offline globalsi

  • ****
  • 167
  • +0/-0
NAT file configuration
« on: March 29, 2017, 04:10:23 PM »
Hi,
Where can I find the file wich contain the NAT configuration ?
Thks

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: NAT file configuration
« Reply #1 on: March 29, 2017, 04:35:00 PM »
If you're talking about PAT rules, they can be set directly from the server-manager (Security -> Port forward). Under the hood, those rules end in /etc/rc.d/init.d/masq. For NAT, there's a single rule, hardcoded in /etc/e-smith/templates/etc/rc.d/init.d/masq/40masqLAN (which is: masqerade outbound IP to the external interface's IP). Depends on what you want to achieve :-)
C'est la fin du monde !!! :lol:

Offline globalsi

  • ****
  • 167
  • +0/-0
Re: NAT file configuration
« Reply #2 on: March 30, 2017, 09:56:02 AM »
Thank you very much for this perfect answer ! (I was actually looking for the PAT)
« Last Edit: March 30, 2017, 09:57:36 AM by globalsi »

Offline globalsi

  • ****
  • 167
  • +0/-0
Re: NAT file configuration
« Reply #3 on: April 03, 2017, 11:18:00 AM »
Do you know what are the templates that generate the port forwarding in /etc/rc.d/init.d/masq ?

I don't find them as 40masqLAN for the NAT.

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: NAT file configuration
« Reply #4 on: April 03, 2017, 11:22:51 AM »
Port forwarding are handled by those templates:

/etc/e-smith/templates/etc/rc.d/init.d/masq/42SetupPortForwarding
/etc/e-smith/templates/etc/rc.d/init.d/masq/91adjustPortForward
C'est la fin du monde !!! :lol:

Offline globalsi

  • ****
  • 167
  • +0/-0
Re: NAT file configuration
« Reply #5 on: April 03, 2017, 12:38:29 PM »
I don't see the port forwarding I created in this files

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: NAT file configuration
« Reply #6 on: April 03, 2017, 12:41:50 PM »
ahem..

you'd tell us what you are trying to achieve (your problem, not your solution), what you did and how you did it.. :-)

"I don't see the port forwarding I created in this files" is quite useless for us, isn't it?

Offline globalsi

  • ****
  • 167
  • +0/-0
Re: NAT file configuration
« Reply #7 on: April 03, 2017, 12:49:15 PM »
Hi,
I want to find the PAT configuration of a broken server
I think I can read the disk by removing it from the machine and I would like to find this information somewhere on the disk.

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: NAT file configuration
« Reply #8 on: April 03, 2017, 01:51:47 PM »
so you need the portforward_* files you find in /home/e-smith/db/ dir on the broken server's hd

Offline globalsi

  • ****
  • 167
  • +0/-0
Re: NAT file configuration
« Reply #9 on: April 03, 2017, 02:04:37 PM »
:) perfect
thank you !

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: NAT file configuration
« Reply #10 on: April 03, 2017, 02:07:10 PM »
you are welcome..

BTW, to avoid the typical X Y problem situation, in the future tell us what's your issue ;-)

thank you