Back up to the FireBrick Category

FireBrick Portmapping

From AAISP Support Site
Revision as of 16:37, 6 July 2021 by AA-Andrew (talk | contribs)
Jump to navigation Jump to search

FireBrick port mapping example

Mapping is done using Firewall rules.

The principle is that you describe the original traffic (source/target interface, IP, protocol, port etc) and then define a Rule with what you want to happen to that traffic - eg, set a new target IP, port and enable NAT.

Typically, your FireBrick will be the original target of the traffic, it will have a public IP on one of its PPP interfaces perhaps. If we take an example for RDP, then we can crate the rule-set as follows:

The Ruleset
<rule-set name="Port Mappings"

And then add a rule for RDP to this rule-set:

 <rule name="Map RDP to server1"

You can add more requirements as needed, such as changing the port if needed, or adding source IPs so as to restrict access to known IPs. You can also use profiles to control access further.

If you have more port mappings then you can add more rule's as required, eg to add access to an internal web server you could map port 8080 to port 80 of the internal webserver:

The rule
 <rule name="Map 8080 to web server2"

You can then test this rule using the built in Firewall test diagnostic.

If you put in:

  • source IP = anything you want
  • Target IP = The FireBrick's IP
  • Protocol = 17
  • Target port = 3389

Then you should see it match your rule and change the target IP etc:

Checking rule-set 5 [Mapping] - Rule 3 [RDP to server1] matched, action is ACCEPT, no further rule-sets considered
NAT set (true)
Target IP set to