Add a webinterface assistant to turn router into modem

turning a openWRT router into a modem requires some steps.
it just took me about an hour to get it working...

it would be nice to have an assistant in the openWRT webinterface,
for a semi-automatic transition between "router mode" and "modem mode"
("modem mode" aka "bridge mode")

other webinterfaces (example: avm fritz os)
have a simple switch to enable/disable the "modem mode"

openWRT: turn a router into a modem

based on the german article: OpenWRT als PPPoE Passthrough Modem

  1. optional: make a backup of your router-mode config
    1. install the rsync package in openWRT > system > software
    2. run: router=192.168.178.1; d=backup/router-mode-$(date --utc +%Y%m%d-%H%M%SZ)/etc/; mkdir -p $d; rsync -rap root@$router:/etc/ $d
  2. you need at least 2 LAN ports
    1. an "internet" port: on this port, the device is a DSL modem
    2. a "management" port: on this port, the device is a DHCP and HTTP server, to provide the openWRT webinterface
  3. first, configure the management port, for example on LAN2
    1. make sure that your LAN2 port is working, otherwise choose a different LAN port
    2. for now, use a different LAN port to configure openWRT, for example LAN1
    3. add new VLAN
      1. openWRT > network > switch
      2. add VLAN
      3. VLAN ID: 2
      4. LAN2 is untagged on VLAN2, off on all other VLANs
      5. CPU is tagged on VLAN2
      6. WAN and all LANs except LAN2 are off on VLAN2
      7. save and apply
    4. add new LAN interface
      1. openWRT > network > interfaces
      2. add new interface
        1. interface name: management
        2. protocol: static address
        3. bridge interfaces: no (default)
        4. interface: Switch VLAN: "eth0.2"
        5. create interface
      3. general settings
        1. bring up on boot: yes (default)
        2. IPv4 address: 192.168.0.1 (or similar)
        3. IPv4 netmask: 255.255.255.0
      4. firewall settings
        1. zone: lan
      5. dhcp server
        1. setup dhcp server
      6. save
      7. save and apply
  4. TODO maybe create multiple management ports as backup
  5. connect your computer to the management port (LAN2) of your router
    1. restart your DHCP client: disconnect, connect
      • this step is needed at least on my computer (linux with networkmanager service)
    2. open the openWRT webinterface on http://192.168.0.1/
      • login with the same admin username/password as before
  6. configure the "internet" LAN port, aka "WAN output" port, aka "modem" LAN port: LAN1
    1. add new VLAN
      1. openWRT > network > switch
      2. add VLAN
      3. VLAN ID: 5
        1. for me, VLAN ID 1 did not work
        2. maybe VLAN ID 7 does not work too
      4. in router mode, WAN is tagged on VLAN7
      5. in modem/bridge mode, WAN is untagged on VLAN5
      6. VLAN5 row:
        1. CPU is tagged
        2. LAN1 and WAN are untagged
        3. rest is off
      7. LAN1 and WAN column:
        1. untagged on VLAN5
        2. rest is off
      8. VLAN1: all are off
      9. save and apply
    2. delete the WAN6 interface. WAN6 is an alias of WAN
      1. openWRT > network > interfaces
      2. WAN_6 > delete
      3. this does not work for me. maybe this step is not needed, because WAN_6 is deleted automatically
    3. edit the WAN interface
      1. openWRT > network > interfaces
      2. WAN > edit
      3. general settings
        1. Protocol: PPPoE -> Unmanaged
        2. Switch Protocol
        3. bring up on boot: yes (default)
      4. Advanced Settings
        1. Use builtin IPv6-management: yes -> no
      5. Physical Settings
        1. Bridge Interfaces: no -> yes
          1. TODO is this correct? or should it be "no"
        2. Interfaces: add eth0.5
          1. before: dsl0.7
          2. after: dsl0.7 + eth0.5
          3. "dsl0.7" is needed for VDSL7 of my ISP (telekom.de)
      6. Firewall Settings
        1. Zone: wan -> unspecified
      7. save
      8. save and apply
  7. add interface: wan_lan1_bridge
    1. openWRT > network > interfaces
    2. add new interface
    3. name: wan_lan1_bridge
    4. Bridge interfaces: no (default)
    5. interface: eth0.5
    6. create interface
    7. general settings
      1. bring up on boot: yes (default)
    8. Advanced Settings
      1. Use builtin IPv6-management: no
    9. save
    10. save and apply
  8. disable firewall
    1. openWRT > network > firewall
    2. zone "lan => wan"
      1. TODO what is the original accept/reject status of input/output/forward
    3. edit
    4. Allow forward to destination zones
      1. remove "wan" -> unspecified
    5. save
    6. save and apply
    7. now the firewall page says: zone "lan => reject"
  9. disable LAN switch
    1. openWRT > network > interfaces
    2. LAN
      1. usually this interface has an IP address like 192.168.178.1
    3. stop
  10. check the switch config
    1. openWRT > network > switch
    2. CPU column: all VLANs are tagged
    3. VLAN2 row: CPU is tagged, LAN2 is untagged, rest is off
    4. VLAN5 row: CPU is tagged, LAN1 + WAN are untagged, rest is off
  11. check your DSL line status
    1. openWRT > status > overview
    2. DSL should be: Line State: UP [0x0]
      1. this does not mean that your modem has an internet connection. this only means that your modem is "ready to connect" (TODO wording. modem is synchronized with some network hardware of the ISP)
  12. connect your computer to the internet LAN port: LAN1
    1. networkmanager
    2. LAN > disconnect
    3. add new connection
    4. type: DSL/PPPoE
    5. enter your ISP login data. example:
      1. service: t-online.de
      2. username: 1111111111112222222222220001
        1. for the t-online.de service, the username is concatted from:
          1. 111111111111 = anschlusskennung
          2. 222222222222 = zugangsnummer
          3. 0001 = mitbenutzernummer
          4. @t-online.de
        2. example username: 1111111111112222222222220001@t-online.de
      3. password: 12345678
    6. connect to the new DSL connection
  13. optional: make another backup of your modem-mode config
    1. connect your computer to the management port (LAN2) of your modem
    2. networkmanager: maybe restart the LAN connection
    3. run: router=192.168.0.1; d=backup/modem-mode-$(date --utc +%Y%m%d-%H%M%SZ)/etc/; mkdir -p $d; rsync -rap root@$router:/etc/ $d

turn a modem into a router: basically do all steps in reverse

related

keywords

  • full bridge mode
  • PPPoE passthrough modem

What modem?

Are you referring to devices with a DSL modem?

yepp. DSL router → DSL modem

i need this to debug my throttled DSL connection.
my ISP claims "we dont throttle"...
i suspect that my router is a bottleneck,
because it has only 64MB RAM
and the conntrack indicator ("active connections")
is always near 100% = 16384 connections

so i want to disable all the fancy router features
and connect my computer directly to the internet (exposed host)

The likely reasons that this "assistant" doesn't exist are:

  • The vast majority of OpenWrt supported devices are routers (or more general purpose systems) that do not contain modems.
  • Only a few DSL modems are actually supported by OpenWrt.
  • It's probably a fair assumption (although I don't have data to back this up) that many people who install OpenWrt on their modem+router devices intend to use the combo device running OpenWrt as their router, too.
  • Developing an "Assistant" like this may require device specific attributes which would make it much harder to develop.

That said, it should be possible to create a script to achieve the goal -- you could share that on the wiki as a means of helping others do the same thing, and if there is interest by others, maybe they could try it on different devices and/or build out the script to handle more devices.

1 Like

I don't see including these packages would make sense as most users would now be fiber with an ONT.

Where I am they are killing off the POTS network and along with-it DSL and ISDN services country wide dial up left several years ago, partly because of 4G, local Wisps and Starlink services becoming common.

4G and Starlink are becoming the go here in rural areas and they are too from exchanges for reliable DSL also many of the road side cabinets are Conklin cabinets sharing a single DSL/ISDN connection with 32 users so it is a bad experience at peak times..

I do admit it is possibly a steep learning curve to setup a 3g/ 4G modem on OpenWrt especially for a new user and maybe that would be a better idea than to have a DSL quick setup feature.

There are a few packages that you need and a few different protocols but installing of modem manager handles the job for most part of it.

But it still come back to that the majority of users likely don't want or need it bloating up their device.

I think it is something like 87% of users in our country are covered by fiber, that does not leave much of a user base for DSL services.

As a note in New Zealand teccos own a majority of the cell towers and the fiber network is government owned.

Providers offer 4G and 5G cheaper than fiber in urban areas as they make more money as they are not paying rental for use of fiber network or pay for the voice port use on the ONT as they can just use VoLTE or VoIP on their own device.

1 Like