LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 August 22 2017

Adnan
Member

Connect modem and router through both wan and lan

Hello,

Can anyone tell me if it's possible to run such a setup ?

Router modem scheme photo

The red part. Basically in addition to the router having the public IP and the modem only acting as a modem, I want to be able to access the modem's interface and telnet by having neither to:
1) Connect to the modem's wireless network.
2) Connect to the modem's LAN ports.

What I want is for the router to act as a LAN client for the modem so I can access the modem while connected to the router's network. But I still don't want this to be done over the WAN connection since if I do that, the public IP will be given to the modem and I will lose some functionality provided by DD-WRT.

I think some bridging stuff can do that ?

The final setup will be:
WAN connection (modem-router bridge):
Modem: No IP, only ADSL modem.
Router: Public IP.

LAN connection:
Between modem and router:
Modem: 192.168.1.1 (host)
Router: 192.168.1.2 (client)

Between router and home devices:
Router: 192.168.0.1 (host)
Devices: 192.168.0.X (clients)
Devices will be able to access the modem by typing 192.168.1.1.


Thanks.

Last edited by Adnan (August 22 2017)

Offline

#2 August 23 2017

InVader
Member

Re: Connect modem and router through both wan and lan

Adnan wrote:

Hello,

Can anyone tell me if it's possible to run such a setup ?

http://image.noelshack.com/fichiers/201 … titled.png

The red part. Basically in addition to the router having the public IP and the modem only acting as a modem, I want to be able to access the modem's interface and telnet by having neither to:
1) Connect to the modem's wireless network.
2) Connect to the modem's LAN ports.

What I want is for the router to act as a LAN client for the modem so I can access the modem while connected to the router's network. But I still don't want this to be done over the WAN connection since if I do that, the public IP will be given to the modem and I will lose some functionality provided by DD-WRT.

I think some bridging stuff can do that ?

The final setup will be:
WAN connection (modem-router bridge):
Modem: No IP, only ADSL modem.
Router: Public IP.

LAN connection:
Between modem and router:
Modem: 192.168.1.1 (host)
Router: 192.168.1.2 (client)

Between router and home devices:
Router: 192.168.0.1 (host)
Devices: 192.168.0.X (clients)
Devices will be able to access the modem by typing 192.168.1.1.


Thanks.

It's possible with the WAN cable  alone, at least with OpenWRT. I suppose it should be feasible with dd-wrt too. From memory:

- Assign the bridge/modem a static local ip on a different subnet than your local lan

- Create a static interface (physical: wan port) without DHCP in your openwrt router and assign it an ip on the modem's subnet. Gateway should probably be your router's local ip. Assign this interface to a firewall zone that will allow the needed traffic

I suggest, for safety, connecting the interface only when you need to access your modem.

Offline

#3 August 23 2017

Mayyad
Member

Re: Connect modem and router through both wan and lan

Hi
If i understood you right, all you have to do is to connect lan to lan and disable the dhcp in the router and the IPs should be in the sane subnet, modem: 192.168.1.1 router:192.168.1.2
This is how i done it at my place, i can access internet and access the modem via wifi by connecting to 192.168.1.1

If you used lan to wan you wont be able to access modem if you are connected to the router wifi because they will have different subnet.
Modem 192.168.1.1 Router 192.168.2.1

Offline

#4 August 23 2017

Kareem
Member

Re: Connect modem and router through both wan and lan

That's what I was exactly trying to do few weeks ago. I have my modem in bridge mode connected to Airport Extreme ( pppoe dialer )

What I found is that the only way to do so was to make the modem wifi join the Airport extreme and be on the same network.

Offline

#5 August 23 2017

Adnan
Member

Re: Connect modem and router through both wan and lan

Okay, I finally got it working. I think it's what @InVader explained. After refining my search I found the proper documentation on the DDWRT wiki here:

https://www.dd-wrt.com/wiki/index.php/A … figuration

I used the primary method. Now all my Internet traffic is routed through the PPPoE bridge. Only when a client requests to access the modem, it gets routed to the modem.

Tracing route to google.com [216.58.205.110]
over a maximum of 30 hops:
  1     1 ms     1 ms     1 ms  DD-WRT [192.168.0.1]
  2    22 ms    21 ms    22 ms  89.108.178.251
  ...
Tracing route to 192.168.1.1 over a maximum of 30 hops

  1     1 ms     1 ms     1 ms  DD-WRT [192.168.0.1]
  2     2 ms     2 ms     2 ms  192.168.1.1

The cool thing now is that I'm able to execute telnet commands on the modem automatically.
I wrote a script and saved it to the router. This script will keep my ADSL speed below a target speed I specify using SNR margin tweaking. In this output, I specified the target maximum speed to be 4199Kbps.

ADSL Speed Regulator V1 starting... 
ASR: current speed is: 6022 
ASR: target speed is: 4199 
ASR: attempting regulation with margin -2500 
Password: ***** 
Copyright (c) 2001 - 2011 TP-LINK TECHNOLOGIES CO., LTD. 
TP-LINK> wan dmt2 set snrm -2500 -2500 
offset = -2500/512 / -2500/512 
TP-LINK> Entering character mode 
Escape character is '^]'. 
ASR: ADSL connection now reset. Waiting... 
ASR: initial speed this loop: 6022 
ASR: waiting for ADSL connection to establish ... 
ASR: attempting to get current speed. Got 3430
ASR: current speed is now 3430

I'm currently doing this because I'm having interference problems on my line at higher speeds, and because it's fun.

Last edited by Adnan (August 23 2017)

Offline

Board footer