OpenWrt Forum Archive

Topic: TL-WR740n v4.2 how to change WAN port

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 there. I'm new with Open-WRT. The reason i installed Open-WRT on this tp-link router is that it's WAN port is dead, and i need to replace it with one or the LAN ports. DD-WRT doesn't support VLAN's on atheros based routers. But Open-WRT does, yes? So as far i achieved to install latest trunk version, no GUI for know, because it cannot access the internet. So can anyone edit network file that let say LAN port number 4 would be WAN? i read documentation, but i  cant do it, i tried to configure it, but worthless. So this is my network file:

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

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

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

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

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

can anyone make it right?

(Last edited by tomaxsas on 14 Sep 2012, 17:12)

anyone?

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

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

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

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

config switch_vlan
    option device 'eth0'
    option vlan '1'
    option ports '0 1 2 3 5t'
   
config switch_vlan
    option device 'eth0'
    option vlan '2'
    option ports '4 5t'
jow wrote:
config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

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

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

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

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

i copied it, uploaded it via WinSCP, rebooted and nothing, i cannot access router, so i have to use failsafe to return to defaults. i read that this chip is switch capable, but i cant make it working

Maybe the CPU port is 0, not 5 on your model. Check with swconfig dev switch0 help (cpu @ x)

jow wrote:

Maybe the CPU port is 0, not 5 on your model. Check with swconfig dev switch0 help (cpu @ x)

yes, CPU @ 0 Now i tiried this:

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

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

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

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

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

but it doesnt worked

If your router has no Auto-MDI-X the WAN port maybe "crossed".
Maybe it works with a crossover cable?

HTH,
Heiko.

please help jow

I managed to install latest version of Open-WRT via SSH, now i have Luci WEB GUI by default.But i still cant managed to configure one lan port into wan, and i start think that router is broken more than i think...

Hi, earlier this week i was unbricking my other router (wr741nd) and noticed a new version of openwrt is released. So i flashed new version on this router (WR740n V4.2) and crated new vLAN via GUI then changed WAN port to use newly created vlan, and  it's working!!!
Steps are simple: create new vlan, disable one port on first vlan and change cpu to tagged, on second vlan change cpu to tagged and that port which is disabled in first vlan change to untagged, reboot router and it should work. Hope this would help someone.

tomaxsas wrote:

Hi, earlier this week i was unbricking my other router (wr741nd) and noticed a new version of openwrt is released. So i flashed new version on this router (WR740n V4.2) and crated new vLAN via GUI then changed WAN port to use newly created vlan, and  it's working!!!
Steps are simple: create new vlan, disable one port on first vlan and change cpu to tagged, on second vlan change cpu to tagged and that port which is disabled in first vlan change to untagged, reboot router and it should work. Hope this would help someone.


tomaxsas

Can you post an step by step with more details. I try but not every was clear to me. I'm having the same problem. Thanks!

Thank you tomaxsas, confirmed success to substitute wan port to one of the LANs ports.
on TL-wrt740n v4.24 , it goes like this:
install openwrt , link http://wiki.openwrt.org/toh/tp-link/tl-wr740n ,  find yours.
log to 192.168.1.1 , user root , password is empty. Dont set root password , if you wont to reset router.
go to "network" tab, under that "swich". Check, if not,  "enable Vlan".
You will see what port is connected to computer "100baseT", other should be empty. Insert internet cable in LAN port, and one icon will change to "100baseT" or something. That port set to off in first vlan. set cpu to taged. rest remain untaged.
Add second VLAN. set cpu on the second VLAN to taged, set same internet port (off in first vlan) to untaged, rest are off.
Save and Apply.

Go to "Interface" tab. On WAN network go to edit , find "Physical Settings" tab, change from ethernet(WAN) to VLAN interface (eth0.2)  (decheck Ethernet, check Vlan...). Leave other settings as is. Save and apply.
Go to "Interface" tab. On LAN network go to edit , find "Physical Settings" tab, change from ethernet(LAN) to VLAN interface (eth0.1)  (decheck Ethernet, check Vlan...). Leave other settings as is. Save and apply.


READ this, what to do -if you do something wrong- to reset router :  http://klseet.com/index.php/tl-wr1043nd … to-factory , I do it many times wink

Go to system, then Reboot.   

ps. in section system - led configuration , first led is "WAN", change if you want, device to "eth0.2" to have visual on internet. (if you later forget what port you set to be WAN)

Thanx tomaxsas again, and be careful.

The discussion might have continued from here.