OPNsense Forum

Archive => 19.1 Legacy Series => Topic started by: thoth on May 28, 2019, 03:35:47 pm

Title: WAN port forward to static host on LAN
Post by: thoth on May 28, 2019, 03:35:47 pm
In my NAT port forwarding rules I have:

A host that gets its IP address from DHCP:
Code: [Select]
WAN TCP * * WAN address 2222 10.2.0.19 22 (SSH)

And another with a static IP address:
Code: [Select]
WAN TCP * * WAN address 2322 10.2.0.220 22 (SSH)

I can ssh through the WAN to the first host by port 2222, but not the second host by 2322

Curiously from the first host I can ssh to the second host (behind the firewall) by port 22, so I am fairly certain that the second host has correctly set it's static IP.  The only difference that I can discern is that the first host is DHCP and the second is static.
Title: Re: WAN port forward to static host on LAN
Post by: amitis5 on May 29, 2019, 12:31:48 am
I'm having this exact same issue.  First port forward rule works, none of the others do.s
Title: Re: WAN port forward to static host on LAN
Post by: thebraz on May 29, 2019, 04:50:30 pm
Could you please try to deactivate DHCP and use only static IP?

I have this configuration and no problem at all port-forwarding on static addressed machines in LAN.

Best Wishes
Title: Re: WAN port forward to static host on LAN
Post by: thoth on June 01, 2019, 06:46:14 pm
I need DHCP on this network, however, the range that DHCP uses does not conflict with the static IP I am using.

As an alternative I have added static mapping for many of the hosts which does seem to work. 

However, hosts that are set to static IP addresses within the OS are not routable.

Furthermore, when attempting the layer 2 metallb tutorial:

https://metallb.universe.tf/tutorial/layer2/

I can see in `k get svc` I do get a static IP address from the service:

```
k get svc nginx
NAME    TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
nginx   LoadBalancer   10.106.58.106   10.2.0.86   80:30025/TCP   94m
```

But, again, anything with a static IP address not set by DHCP cannot be routed to.
Title: Re: WAN port forward to static host on LAN
Post by: thoth on June 02, 2019, 05:47:41 pm
I've also enabled BGPv4 and tried both enabling and disabling OSPF, but I still do not seem to be able to get static hosts to have the same sort off peerage as the DHCP hosts in my network
Title: Re: WAN port forward to static host on LAN
Post by: thoth on February 06, 2020, 03:11:32 am
moving discussion here:
https://forum.opnsense.org/index.php?topic=15756.0