[SOLVED] How to access the modem (which is in bridge mode)?

Google search didn't help much so I thought I should better ask.

The connection is a typical ADSL.

At the moment if I want to access the modem's interface I connect an ethernet cable from a modem's LAN port to one of the router's (LEDE) LAN port.

Is there another way to access the modem, without having to use an extra cable?

I edited the topic's title and added a "which is".
I think it's more understandable now.

The modem and the LEDE router are on the same subnet
modem is 192.168.1.254
router is 192.168.1.1

Is this the right way to go or the two devices should be in different subnets?

Change your Router to another subnet and

ifconfig `uci get network.wan.ifname`:0 192.168.1.254 netmask 255.255.255.0

iptables -t nat -I POSTROUTING -o `uci get network.wan.ifname` -d 192.168.1.0/24 -j MASQUERADE

just in case, give me the output of ifconfig -a and uci show network to check if it is all fine (remove the macaddresses).

It doesn't seem to work.

I changed the modem's IP to 192.168.2.1 (left router at 192.168.1.1)
and run

ifconfig `uci get network.wan.ifname`:0 192.168.2.1 netmask 255.255.255.0
iptables -t nat -I POSTROUTING -o `uci get network.wan.ifname` -d 192.168.2.0/24 -j MASQUERADE

but http://192.168.2.1 is still inaccessible.

ifconfig -a

br-lan    Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: X::X:X:X:X/64 Scope:Link
          inet6 addr: X:X:X::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:262 errors:0 dropped:0 overruns:0 frame:0
          TX packets:187 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22517 (21.9 KiB)  TX bytes:32657 (31.8 KiB)

eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:127 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:11394 (11.1 KiB)
          Interrupt:4

eth1      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:71 errors:0 dropped:0 overruns:0 frame:0
          TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11689 (11.4 KiB)  TX bytes:8199 (8.0 KiB)
          Interrupt:5

ifb0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          BROADCAST NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ifb1      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          BROADCAST NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:300 (300.0 B)  TX bytes:300 (300.0 B)

pppoe-wan Link encap:Point-to-Point Protocol
          inet addr:X.X.X.X  P-t-P:X.X.X.X  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:58 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:9573 (9.3 KiB)  TX bytes:6384 (6.2 KiB)

wlan0     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet6 addr: X::X:X:X:X/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:12504 (12.2 KiB)

wlan1     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet6 addr: X::X:X:X:X/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:261 errors:0 dropped:0 overruns:0 frame:0
          TX packets:186 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26165 (25.5 KiB)  TX bytes:37483 (36.6 KiB)

uci show network

network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='X:X:X::/48'
network.lan=interface
network.lan.type='bridge'
network.lan.ifname='eth0'
network.lan.proto='static'
network.lan.ipaddr='192.168.1.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.wan=interface
network.wan.ifname='eth1'
network.wan.proto='pppoe'
network.wan.username='XXXXXXXXXX'
network.wan.password='XXXXXXXXXX'
network.wan.ipv6='0'
network.wan.auto='1'
network.wan6=interface
network.wan6.ifname='eth1'
network.wan6.proto='dhcpv6'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='1'
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device='switch0'
network.@switch_vlan[0].vlan='1'
network.@switch_vlan[0].ports='1 2 3 4 0'
network.vpn0=interface
network.vpn0.ifname='tun0'
network.vpn0.proto='none'
network.vpn0.auto='1'

hello,
here at the bottom of the page :
https://lede-project.org/docs/user-guide/basic-ipv4-configuration

Assigning multiple ip addresses to the same interface:

config interface wan
  option ifname eth0   #wan port of the router
  list ipaddr 192.168.1.1/24 # Router IP address in the Lan subnet
  list ipaddr 192.168.0.2/24 # IP address in the Modem Bridge subnet

is this a correct way to access your bridge modem interface ?

@shdf
That doesn't work either, thank's anyway.

I noticed there is not a clear and moreover working method of accessing the modem...
Anyway... if anyone else has an idea, please share it with us.

Cheers!

In your case, with modem and router in different subnets, I would create another interface on the router with a fixed IP address in the modems subnet and add that interface to the wan zone in the firewall setup.

Best Regards

1 Like

IT WORKS!
Finally! :clap:

The newly created modem interface must have a random IP in the modem's subnet and not the IP of the modem itself. That was what I was doing wrong!

Thank's a lot @moeller0 !

So... to sum up:

  1. If the LEDE router is at 192.168.1.1 , set the modem at a different subnet, e.g 192.168.2.1

  2. Create the modem interface in /etc/config/network

config interface 'modem'
option ifname 'eth1'
option proto 'static'
option ipaddr '192.168.2.100'
option netmask '255.255.255.0'

  1. Add modem at the wan zone in /etc/config/firewall

option network 'wan wan6 modem'

And you're done!

Once again thank's a lot guys!

8 Likes

Thank you very much, it worked also for me ! :sunglasses:

Here is how to do it with LuCI: https://simplebeian.wordpress.com/2014/03/12/accessing-your-modem-from-openwrt-router/

The guide works, but one thing I've wondered to myself for awhile, on the interfaces tab, why is it that the modem interface is showing significant TX and RX numbers? For the WAN interface this makes sense, but the way I am thinking about it, the modem interface should only show #s if they're being actively used.. and that web interface to it is seldom used.. So what is the story with the TX and RX?
Currently says RX: 3.24 GB (35124131 Pkts.) TX: 921.44 MB (25787503 Pkts.) on mine.

I cant tell u the reason why, but i can tell u its the same with my bridged modem setup.

pppoe-wan shows: RX: 33.74 GB (23636474 Pkts.) TX: 830.17 MB (12121530 Pkts.)
modem interface shows: 33.91 GB (23708235 Pkts.) TX: 1.10 GB (12192136 Pkts.)

So i guess its kinda normal with such a setup ?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.