How to redirect wifi traffic from ISP router through my own router

Hi! I'm absolute beginner at networking and there is problem which I don't even know where to start.

My current network setup is the following:

one_picture_worth_1000_words

<====> cable connection
<----> wireless connection

INTERNET <====> ISP_ROUTER 192.168.1.1 <====> MY_ROUTER 192.168.2.1 <----> CLIENT 192.168.2.xxx

so packages go like that:

  1. REQ: CLIENT --> MY_ROUTER (adblock etc.)
  2. REQ: MY_ROUTER ==> ISP_ROUTER
  3. REQ: ISP_ROUTER ==> INTERNET
  4. RES: INTERNET ==> ISP_ROUTER
  5. RES: ISP_ROUTER ==> MY_ROUTER (adblock etc.)
  6. RES: MY_ROUTER --> CLIENT

I'd like to connect CLIENT to ISP_ROUTER but still have the traffic through MY_ROUTER before it goes to INTERNET:

  1. REQ: CLIENT --> ISP_ROUTER
  2. REQ: ISP_ROUTER ==> MY_ROUTER (adblock etc.)
  3. REQ: MY_ROUTER ==> ISP_ROUTER
  4. REQ: ISP_ROUTER ==> INTERNET
  5. RES: INTERNET ==> ISP_ROUTER
  6. RES: ISP_ROUTER ==> MY_ROUTER (adblock etc.)
  7. RES: MY_ROUTER ==> ISP_ROUTER
  8. REQ: ISP_ROUTER --> CLIENT

If it's possible at all, how to make it?

Thank you in advance!

the desired set up is only possible if the ISP's router either have customizable firewall rules, or customizable DHCP settings.
you either have to redirect the DNS traffic to your adblock via a firewall rule, or by DHCP option 6.

Generally, you can't... the simple solution is to connect everything to your OpenWrt router instead. There are more complex options potentially available, but given that you state you are a beginner, you probably don't want to dive in head first to super complex configs.

Disable wifi on your ISP router, enable it on your OpenWrt device. Done.

Or... replace the ISP device (if possible) with OpenWrt. From there, you might be able to make the ISP router into a simple bridged AP so it is wifi only and not performing routing. All routing (and also DNS and the like) can be handled by OpenWrt.

1 Like

No, unfortunately there are just very basic settings on ISP_ROUTER. Thanks anyway!

Well, ISP router has wifi6 while my router only wifi5. And ISP router has fiber connection with Internet. I guess I'll need to buy some better router with wifi6. Cheers!

Have a look at this (rather old) tutorial, an interesting solution is presented starting at 15:15. He’s using an additional MY_ROUTER - ISP_ROUTER ethernet connection to bring the lan subnet to wireless devices connected to ISP_ROUTER. Only works when there’s no DHCP on ISP_ROUTER so that connected devices get their IP from the lan. I've had this running without problems in the past, before rearranging my Wifi setup not needing the ISP router’s Wifi any more.

Hi bedouin67, I tried to implement the idea you shared (many thanks for that) however it didn't work for me. Maybe I didn't understand everything or some other settings are blocking the solution to work in my case, but what I did was:

  1. Set MY_ROUTER IP static 192.168.1.100 on ISP_ROUTER
  2. Disable DHCP on ISP_ROUTER
  3. Cable connect ISP_ROUTER eth <==> MY_ROUTER eth. (Please note that there is still connection ISP_ROUTER eth <==> MY_ROUTER wan exists)

And indeed, my mobile phone connected to ISP_ROUTER changed IP from 192.168.1.xxx to 192.168.2.yyy. However, Internet connection disappeared for all the devices connected to 192.168.2.0/24 subnet - that mobile phone as well as my PC connected with cable to MY_ROUTER. Moreover, I couldn't connect to ISP_ROUTER 192.168.1.1 at all and had to reset all the settings. What am I doing wrong here?

Don't use WAN port, lan IP of OpenWRT router have to be in 192.168.1.x, but obviously not the same as lan side IP of the ISP's router.

You need to use option 3 to point out the ISP's lan router IP as the default gw in the DHCP, as described in https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#dhcp_options.

Don't use WAN port,

So you're saying that instead of what I tried:

INTERNET <==> ISP_WAN
..............ISP_ETH0 <==> MY_WAN
..............ISP_ETH1 <==> MY_ETH0
..............ISP_ETH2

I should connect it like below?

INTERNET <==> ISP_WAN
..............ISP_ETH0 .... MY_WAN
..............ISP_ETH1 <==> MY_ETH0
..............ISP_ETH2 <==> MY_ETH1

Don't use WAN port on Openwrt router.

Connect LAN port to LAN port, using only one Ethernet cable.

ok, that's what I did:

connect ISP_ETH <==> MY_ETH
ISP_ROUTER: set MY_ROUTER static IP 192.168.1.100
MY_ROUTER/OpenWRT
....wan interface
........DHCP client --> static IP 192.168.1.100
........IPv4 netmask: 255.255.255.0
........IPv4 gateway: 192.168.1.1
........DNS: 9.9.9.9
........DHCP server --> Advanced Settings --> DHCP-Options --> 3,192.168.1.1
ISP_ROUTER: turn off DHCP

and now my PC connected to MY_ROUTER is working fine, specifically I'm able to connect to 192.168.2.1/MY_ROUTER/OpenWRT; 192.168.1.1/ISP_ROUTER; Internet. However my mobile phone connected via wi-fi to ISP_ROUTER is getting error 'Not able to get IP address'. Any clue?

Where did the 2.1 subnet IP come from ?

Wifi and LAN most likely aren't interconnected inside ISP's router, as they are in Openwrt.
This is probably caused by you disabling the DHCP.

Where did the 2.1 subnet IP come from ?

MY_ROUTER/OpenWRT --> Interfaces --> lan
....Protocol --> Static address
....Device --> br-lan
....IPv4 address --> 192.168.2.1
....IPv4 netmask --> 255.255.255.0
....IPv4 gateway --> blank (showing: 192.168.1.1 (wan))
....IPv4 broadcast --> blank (showing: 192.168.2.255)

Ok, you're not following the instructions you've been given, have fun failing on your own.

Ok, you're not following the instructions you've been given, have fun failing on your own.

That's the part of learning :wink: thanks for the help you provided, cheers!

1 Like

Finally, got it work! Many thanks for all your comments, especially @bedouin67 and @frollic for your help. Below I'm pasting the steps I followed. If you see any problems with the setup (is it secure? Maybe some firewall settings could help?), please let me know. Cheers!

Step 0 - starting point
ISP_ROUTER connected to Internet
MY_ROUTER no connection, freshly installed OpenWRT with default settings

Step 1 - connect laptop to MY_ROUTER on any ETH port

Step 2 - set static IP (192.168.2.1 is my choice)
MY_ROUTER/Network/Interfaces/lan
....General Settings
........IPv4 address: 192.168.2.1
........IPv4 netmask: 255.255.255.0

Step 3 - connect cable MY_ROUTER/WAN to ISP_ROUTER/ETH

Step 4 - on ISP_ROUTER check which IP was assinged to MY_ROUTER. It's 192.168.1.183 .

Step 5 - set WAN on MY_ROUTER
MY_ROUTER/Network/Interfaces/wan
....General Settings
........IPv4 address: 192.168.1.183
........IPv4 netmask: 255.255.255.0
........IPv4 gateway: 192.168.1.1
....Advanced Settings
........Use custom DNS servers 8.8.8.8
........Use custom DNS servers 8.8.4.4

Step 6 - connect cable MY_ROUTER/ETH to ISP_ROUTER/ETH

Step 7 - disable DHCP on ISP

dude!

you made it work, but in case of power failure, or any reboot of your ISP router for example after any automatic update, it is possible to lose the assigned IP of MY_ROUTER

the solution is simpler that you think, because the correct question would be, “how to use your OpenWRT Router, only for AdBlock, firewall etc., but traffic through ISP router”

step 1: connect both routers with ETHERNET (do not use any WAN port, just simple LAN) and disable DHCP on ISP_ROUTER

step 2: remove WAN&WAN_6 from Network Interfaces on MY_ROUTER

step 3: give static IP for LAN interface on MY_ROUTER
(Network→Interfaces→LAN→Protocol: Static address)
eg:
IP: 192.168.1.254
NetMask: 255.255.255.255
Gateway: 192.168.1.1 (the static IP of the ISP_ROUTER)
Broadcast 192.168.1.255

step 4: edit custom DNS servers for LAN interface on MY_ROUTER

step 5: check/enable DHCP for LAN interface on MY_ROUTER

step 6: disable the wireless Interfaces on MY_ROUTER

with the above setup, all your wi-fi devices will use your ISP_ROUTER but all other services like Adblock will be handled from MY_ROUTER

Thank you @tsakalof for the suggestion, I'll try that out once I have some free time.

And regarding

it is possible to lose the assigned IP of MY_ROUTER

well, I was not specific but step 5 in my manual should be "set WAN static IP" - does it prevent from losing the assigned IP for MY_ROUTER?

Only really steps 7 and 5 are required, plus not using wan port, unless it's been moved to the LAN firewall zone.

ok, now it makes more sense, but once again:
you must disable the DHCP server in ISP_ROUTER else it will be more complicated to setup and to use MY_ROUTER for Adblocking etc.

This is the reason why you have to disable DHCP in ISP_ROUTER which means you will have to enter manually a static IP address for MY_ROUTER.

It is better not to use the WAN port (therefore delete WAN & WAN_6 interfaces in MY_ROUTER) else you will not have access to ISP_ROUTER and it’s settings. It is suggested to connect both routers by using the LAN ports, as per my configuration.

if you want more security and privacy, you can use the following DNS service:
Service Addresses & Features | Quad9
IPv4

  1. 9.9.9.9
  2. 149.112.112.112