I would need some help. I have a Linksys WRT1900ACS with OpenWRT (ARMv7 Processor rev 1 (v7l)) on it.
I ran the default setup, configured a public IP from which I can have access to the internet.
However, I have more 4 more public IPs from the same ISP that I need to use. How can I add another public IP and point it to a HOST on my network ? It has to be a 1-1 NAT. So whatever comes on that public Interface it should be forwarded as it is to a HOST on my network (like a DMZ) and vice versa.
Have you checked the SNAT in Network-Firewall-Traffic Rules?
I have never tried it so maybe you would also need to add a port forward too for all protocols, for external address the public IP and internal address of the LAN host.
Hey Thank you so much, I actually tried that, but never worked !
For Inbound traffic,
uci add firewall redirect
uci set firewall.@redirect[-2].name=webgw1-ingress
uci set firewall.@redirect[-2].target=DNAT
uci set firewall.@redirect[-2].src=wan
uci set firewall.@redirect[-2].dest=lan
uci set firewall.@redirect[-2].src_ip=MY PUBIC IP
uci set firewall.@redirect[-2].dest_ip=MY PRIVATE IP
uci set firewall.@redirect[-2].proto=all
uci commit firewall
FOR SNAT,
uci set firewall.@redirect[-1].name=webgw1-egress
uci set firewall.@redirect[-1].target=SNAT
uci set firewall.@redirect[-1].src=lan
uci set firewall.@redirect[-1].dest=wan
uci set firewall.@redirect[-1].src_dip=MY PUBLIC IP
uci set firewall.@redirect[-1].src_ip=MY PRIVATE IP
uci set firewall.@redirect[-1].proto=all
It still doesn't redirect everything to my HOST. The firewall rules for MAIN IP seem to work only. Not the additional Public IPs I added.
Do I need to create a separate ifname ? Because both of them share the same eth1.2. The is the default VLAN created when I assigned the static IP (Public IP 1) to the router.
Not sure why DNAT / SNAT rules don't work as we are specifying From / To correctly
So what was the problem and it was not working before?
If your problem is solved, feel free to mark the relevant post as the solution; and edit the title to add "[SOLVED]" to the beginning (click the pencil behind the topic).