Closed lpvm closed 3 years ago
Hi,
if you write it: map ure0 dynamic proto tcp 192.168.1.30 port 17106 <- 3.3.3.3 port 17106 does it work?
regards, spz -- @.*** (S.P.Zeidler)
Hi @spzeidler , thank you for your interest.
Tried the line both with the proto tcp
and without it, but doesn't work either way.
@lpvm: You have the port forwarding rule, but where is the rule to pass the traffic to port 17106?
I had those before, but didn't work either. Unless I'm understanding it wrong, they are not necessary. In the npf documentation, it's stated that
map $ext_if dynamic $local_host_2 port 80 <- $ext_if port 8080 In the examples above, NPF determines the filter criteria from the segments on the left and right hand side implicitly.
@lpvm: They are necessary. The filter criteria mentioned in the documentation is for the translation rule. Such rule doesn't implicitly pass the traffic; try adding pass in stateful ... port 17106
on $ext_if
and check your traffic with tcpdump.
Hi @rmind , sorry for my ignorance, but as I don't have enough knowledge of the subject, I miss some points and misunderstand others.
I added this line:
pass stateful in final to inet4(ure0) port 17106
As my ure0
acquires a dynamic IP, the line should be changed to:
pass stateful in final to ifaddrs(ure0) port 17106
right?
One thing I took notice is that when a port in a rule is specified as $17166
, for example, npf ignores the $
.
Other thing that for less knowledgeable people is important are examples. Unfortunately, few people use NetBSD...
This is solved, thank you very much @rmind and @spzeidler .
@lpvm: Well, pull requests with better examples or improved documentation are always welcome!
Description
I want to enable port forwarding of ports 17106 and 22222 to a computer on LAN. I've already asked for help, but got no answers to the problem that could solve it.
The NetBSD box runs:
net.inet.ip.forwarding=1
From the NetBSD box I can access the LAN computer:
From outside, the Internet, I cannot access it.
In the NetBSD computer, when listening on the external interface, after some seconds:
The
npf.conf
file:3.3.3.3
and4.4.4.4
are not he real IPs.Don't know what else to do or check.