Redirecting all wifi clients to local server ip

hi team, i have a NAS server and xiaomi 4a gigabit router with openwrt... i need some help

router with no wifi encryption and ethernet cable from lan1 to NAS server

i want to redirect all wifi clients (router ip: 169.254.107.1) to my NAS server (169.254.107.98)

when user connects with wifi automate redirect to ip of NAS....NO INTERNET CONNECTION only to server ip
i'll try with captive portal but nothing...

What do you want to redirect?

http, https portal from NAS

What you need is called a "captive portal". Google it, and you will find tons of resources.

I know what is...... I write in the beginning ill try but nothing...any solution with iptables or something else?

Are these the actual IP address you are using on your network? This may be a problem, since they are not RFC1918 addresses (you should use RFC1918 addresses on any LANs that you create, APIPA addresses should be avoided).

1 Like

its lan network without internet....everything i want is local

make some changes but nothing

iptables -t nat -A PREROUTING -d 169.254.107.1 -j ACCEPT

iptables -t nat -A PREROUTING -d 169.254.107.98 -j ACCEPT

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 169.254.107.98:80

iptables -t nat -A POSTROUTING -j MASQUERADE

It is still best to use RFC1918 addresses. Some OSs may not like using link-local addresses, and I'm not sure if routing actually works properly when using it (link local is considered non-routable).

Per this description:

Link-local addresses are not guaranteed to be unique beyond their network segment. Therefore, routers do not forward packets with link-local source or destination addresses.

2 Likes

ok i'll change ip addresses.......with 10.0.0.1 for openwrt

10.0.0.254 for server

any ideas? nothing?........little help there