NAT-ed public IP, how to configure routing on OpenWrt

Hi, i have new ISP from today. I have public IP, although i get 192.168.x.x ip on WAN. How can i configure routing on openwrt properly so when i want to connect to my public ip, traffic will not go to ISP and again to my openwrt router. I don't have any additional router between openwrt router and ISP ONT FTTH to RJ45 media converter.

Then you don't have a public IP.

You'll have to ask your ISP.

Not sure what this means.

1 Like

I have, but its behind NAT. Its works like DMZ from public ip to my WAN local ip.

When my public ip is not in any routing table or not assigned to any interface, traffic for it will go to ISP then being nated and go back to my openwrt router.

Then you need to ask the ISP how the DMZ works/is set up.

... of ?

have you got a link to some info regarding this, from your ISP ?

If your router doesn't have a public IP on the wan interface, then you are behind CGNAT.
There is nothing to configure on the routing tables.
If you need to connect to your internal servers, better create a hostname for them and use that instead.

1 Like

Of my openwrt router. If i want to connect to my Public ip address, openwrt cannot find it it its routing table so it passed it to isp gateway where it is translated to my "local public" ip and returns to my openwrt router.

Sadly not, i thought i will get "normal" public ip

Traffic to my public ip leaves my openwrt router and goes to isp gateway so it is clearly not working like it should. It should be recevied and processed directly by openwrt.

coming from where ?
LAN or internet ?

how should it work, in your opinion ?

not going to happen, as long as you're (CG)NATed, same would still apply if
the DMZ was working, but at least it'd reach you.

1 Like

from LAN.

I thought about some sort of NATing my wan local ip to my public ip to reverse this.

And that would be the case if you had a public IP on the wan interface.
Now you are NATed behind some router/firewall of your ISP.
What you can do, if it makes you happy, is to add this IP as an alias on the wan interface.

1 Like

why would you need to access your "public" IP from within your own LAN ?

1 Like

Thank you! I will try adding alias with public ip. it seems like it could work like i wanted to.

For example when i access my nextcloud. DNS name for NC points to my public ip.

you can scratch that, since you don't have one, any more.

1 Like

But i have one, its just not terminated on my router.

You and X^y others, if you think it's yours only, you're wrong.

But i paid for it, i clearly have "public ip" on the invoice. and it should pass incoming connections on any tcp/udp port to my router.

That should have been mentioned earlier.
Then you need to ask them how the public IP works, and how the traffic is being forwarded.

1 Like

what you are looking for is bridge mode.

at this moment, according to your experience, the ISP's device has a WAN side with your public IP, and it has a "LAN" side which to you connect your owrt WAN port. hence you see only a private IP within owrt.

with bridge mode (which can enabled on ISP device by you or by asking ISP) your ISP device will act as an intelligent cable and let owrt to establish/manage the internet connection (client end only of course). Depending on technology used by ISP may need to set owrt WAN interface to use DHCP or PPPOE protocol.

How is your OpenWrt router connected to the internet? Is there a cable/dsl modem or ONT connection? another router to which you connect your OpenWrt router? Basically, from the physical cable that comes into your home, what is between that and the openwrt device?