OpenWrt Forum Archive

Topic: Broken WAN port after storm, how to change LAN port into WAN

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all

Please help me. Dont know what need i do if my wan port is broken.
I installed openwrt
What need i change?

thanks who help me

(Last edited by mogyi23 on 14 Mar 2016, 23:49)

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 'fd21:da5e:ace3::/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'

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'

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

~
~
~
~
- /etc/config/network 1/38 2%

What router do you have?

tp-link tl-wr841n

Warning: Learn how to get into failsafe first, because if something goes wrong you might not be able to connect to your device until you fix the configuration. Read general information about failsafe at doc/howto/generic.failsafe and specific information for your device at toh/tp-link/tl-wr841nd#failsafe_mode.

mogyi23 wrote:

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

Change the option ports line in this section to:

option ports '0t 1 2 3'

Add a second VLAN section using port 4:

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option vid '4'
        option ports '0t 4'

Change the WAN interface to use the new VLAN:

config interface 'wan'
        ...
        option ifname 'eth0.4'
        ...

Change the LAN interface to use the VLAN interface:

config interface 'lan'
        ...
        option ifname 'eth0.1'
        ...

Now, port 4 should work like a WAN port (you'll need to run /etc/init.d/network restart, or just reboot the router). Beware though, the logical port 4 (configured in the software) might not be labeled port 4 on the case. Apparently your device can have a number of different mappings, see toh/tp-link/tl-wr841nd#switch_configuration for some hints. If you're unsure, find a port that works as LAN, log in, and try connecting WAN to the other ports and see which one works.

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 'fd21:da5e:ace3::/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'

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

config interface 'wan6'
        option ifname 'eth1'
        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 vid '1'
        option ports '0t 1 2 3'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option vid '4'
        option ports '0t 4'

Thanks a lot! Port 4 is the wan. i write all right?

I think
config interface 'wan6'
        option ifname 'eth1'
        option proto 'dhcpv6'
should be

config interface 'wan6'
        option ifname 'eth0.4'
        option proto 'dhcpv6'
or delete all.

mogyi23 wrote:

Thanks a lot! Port 4 is the wan. i write all right?

Yes, it looks like you made the correct changes. I missed one section:

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

ifname here should also be eth0.4, like the interface 'wan' section. If your ISP doesn't support IPv6 this doesn't matter, but you might want to change it so it works when your ISP enables IPv6 support.

thanks a lot

i done the network modifie
put the utp cabel and have no link sad
whats the problem? dont know...

sorry my abd english sad

http://kepfeltoltes.hu/160315/01_www.kepfeltoltes.hu_.png

http://kepfeltoltes.hu/160315/02_www.kepfeltoltes.hu_.png

If i put the utp cabel to port 1 than on the second picture i have link on port4 and the first picture same

Fine i try it and working but the wan port is now port1!!!
Thanks a lot

(Last edited by mogyi23 on 15 Mar 2016, 19:25)

Port showed on luci that did not match as number port you set.

The discussion might have continued from here.