Configure LAN port as WAN on WR841N

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

pehape
Posts: 2
Joined: Sat Jul 11, 2015 12:02 pm

Configure LAN port as WAN on WR841N

Post by pehape »

Hi,

after a storm my router's WAN port stopped working properly, I suspect it's broken. I found a couple results on how to change the switch configuration to use a LAN port as a new WAN port, however they are based on different models/firmwares and I can't see how to adapt them for my case.

My /etc/config/network is as follows:
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd6c:a43f:74a3::/48'

config interface 'lan'
option ifname 'eth0'
option force_link '1'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.2.1'
option dns '192.168.2.1'

config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'

config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 1 2 3 4'
Thanks!

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Configure LAN port as WAN on WR841N

Post by Lantis »

Everything you need to accomplish this is on this page:
http://wiki.openwrt.org/toh/tp-link/tl-wr841nd
In particular the switch configuration table.

Your situation - Old
WAN - Eth1
LAN1,2,3,4 - LAN ports

Your situation - New
WAN - Dead.
LAN1 - New WAN
LAN2,3,4 - LAN ports

Solution.
Throw Eth1 in the bin, it's dead (i.e. Don't assign anything to it)
Create 2 VLANs. 1 for your new WAN and one for your new LAN ports.
We will call the LAN one Eth0.1, and the WAN Eth0.2.

Code: Select all

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd6c:a43f:74a3::/48'

config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.2.1'
option dns '192.168.2.1'

config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'

config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0t 1 2 3'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 4'
You should apply these changes via WiFi or you'll lose connection to the router.
Also restart the network to apply the changes.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

pehape
Posts: 2
Joined: Sat Jul 11, 2015 12:02 pm

Re: Configure LAN port as WAN on WR841N

Post by pehape »

Thanks!

That worked perfectly :)

TomaszM
Posts: 8
Joined: Wed Jan 06, 2016 5:40 pm

Re: Configure LAN port as WAN on WR841N

Post by TomaszM »

Great topic !

now i have the same problem, very similar etc/config/network

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd8d:4f68:4d2X3::/48'

config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option dns '192.168.1.1'

config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'

config interface 'wan6'
option ifname 'eth1'
option proto 'dhcpv6'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
option blinkrate '2'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 1 2 3 5t'

config switch_port
option device 'switch0'
option port '1'
option led '6'

config switch_port
option device 'switch0'
option port '2'
option led '9'

config switch_port
option device 'switch0'
option port '5'
option led '2'
but ..... i don't know how to edit ... change this file :oops:
help rookie !
which command ... which parameters

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Configure LAN port as WAN on WR841N

Post by Lantis »

The easiest way is to use WinSCP for Windows.
The address is the IP of the router (usually 192.168.1.1).
Password is your password.
Set the protocol to SCP.

Do you understand everything else in the thread?
You need the port table from here: https://wiki.openwrt.org/toh/netgear/wndr3700

Code: Select all

Port.              Switch port
CPU (eth0).           5
No port.              4
LAN 1.                3
LAN 2.                2
LAN 3.                1
LAN 4.                0
And you need to create two VLANs.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

TomaszM
Posts: 8
Joined: Wed Jan 06, 2016 5:40 pm

Re: Configure LAN port as WAN on WR841N

Post by TomaszM »

WinSCP was better idea, thanks !!!

Anyway i just copied your previous solution code .... and it doesn't work :(

My situation:
WAN - Dead
LAN1 - New WAN
LAN2,3- LAN ports
LAN4 - Dead

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Configure LAN port as WAN on WR841N

Post by Lantis »

Because that is for a different router. Yiu need to develop your own settings using the port table.

Your WAN vlan will be 3, 5t
Your LAN vlan will be 1,2,5t
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

TomaszM
Posts: 8
Joined: Wed Jan 06, 2016 5:40 pm

Re: Configure LAN port as WAN on WR841N

Post by TomaszM »

So for may WNDR3700v2 it should be sth like this ? :roll:
  • config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

    config globals 'globals'
    option ula_prefix 'fd8d:4f68:4d2X3::/48'

    config interface 'lan'
    option ifname 'eth0.1'
    option force_link '1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option dns '192.168.1.1'

    config interface 'wan'
    option ifname 'eth0.2'
    option proto 'dhcp'

    config interface 'wan6'
    option ifname 'eth1'
    option proto 'dhcpv6'

    config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'
    option blinkrate '2'

    config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '1 2 5t'

    config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '3 5t'

    config switch_port
    option device 'switch0'
    option port '1'
    option led '6'

    config switch_port
    option device 'switch0'
    option port '2'
    option led '9'

    config switch_port
    option device 'switch0'
    option port '5'
    option led '2'

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Configure LAN port as WAN on WR841N

Post by Lantis »

Looks good to me :)
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

TomaszM
Posts: 8
Joined: Wed Jan 06, 2016 5:40 pm

Re: Configure LAN port as WAN on WR841N

Post by TomaszM »

:( but it doesnt work.....

Post Reply