Greetings. I have public NIC with few public IPs assigned;
$ext_if = my external NIC with my public Internet addresses
$public_IP_1 = one of my public Internet IP (assigned as an alias and working on $ext_if)
And 10.10.10.2 is my jail running on FreeBSD 14 host machine.
I have the following PF rules to redirect Internet ports of the mail services, to one of my Jail;
So far, they seem to be working. For instance, a connection to My.Public.IP port 465, 110 goes to the same port running in Jail.
However, my jail cannot reach outside, cannot ping to a public IP address, cannot connect to a public website. How to allow these without adding a general NAT rule? Like:
nat on $ext_if from ($int_if:network) to any -> ($ext_if:0)
With such a rule above, I have no problem about the outside connection of the jails, but I feel like my jails ($int_if) are too *public* and not restrictive.
Is it mandatory to set up such a NAT rule in PF in my case?
Is there any way to allow jails to do ping, traceroute, connecting to 80 ports of public servers, without NAT?
A rule like this did not work;
pass out on $ext_if proto icmp from 10.10.10.2 to any
Any clue would be much appreciated - many thanks in advance.
$ext_if = my external NIC with my public Internet addresses
$public_IP_1 = one of my public Internet IP (assigned as an alias and working on $ext_if)
And 10.10.10.2 is my jail running on FreeBSD 14 host machine.
I have the following PF rules to redirect Internet ports of the mail services, to one of my Jail;
Code:
rdr on $ext_if inet proto tcp from any to $public_IP_1 port {smtp, submission, smtps, imap, imaps, pop3, pop3s} -> 10.10.10.2
pass in on $ext_if proto tcp from any to 10.10.10.2 port {smtp, submission, smtps, imap, imaps, pop3, pop3s}
So far, they seem to be working. For instance, a connection to My.Public.IP port 465, 110 goes to the same port running in Jail.
However, my jail cannot reach outside, cannot ping to a public IP address, cannot connect to a public website. How to allow these without adding a general NAT rule? Like:
nat on $ext_if from ($int_if:network) to any -> ($ext_if:0)
With such a rule above, I have no problem about the outside connection of the jails, but I feel like my jails ($int_if) are too *public* and not restrictive.
Is it mandatory to set up such a NAT rule in PF in my case?
Is there any way to allow jails to do ping, traceroute, connecting to 80 ports of public servers, without NAT?
A rule like this did not work;
pass out on $ext_if proto icmp from 10.10.10.2 to any
Any clue would be much appreciated - many thanks in advance.