OpenWrt Forum Archive

Topic: (Solved) How to configure LAN Port as WAN on OpenWRT?

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.

I have TP-Link TL-WR841N V8.4 Router whose WAN Port is not functional. I need to configure one of the LAN port as WAN port so that I can connect to PPPoE connection. I have OpenWRT installed on my router and have tried various methods but unfortunately nothing worked. I need a working solution by which I can directly change settings through web interface of the router.

(Last edited by Hitesh.Kirtane on 27 Oct 2017, 17:02)

First, be logged into the router via wifi so if you mess up the ethernet port configuration you can still log in.

Go to the switch page and set up two VLANs.  One (number it VLAN 1) has three of the ports untagged, and tagged to the CPU.  The other (make it VLAN 2) has the port you want to use for WAN untagged, and tagged to the CPU.  The cable ports need to be untagged in one VLAN and off in the other.  The CPU needs to be tagged in both.   Note that the cable port numbers are mixed up compared to how they are marked on the box.  You can plug and unplug a live cable and watch the status icons to see which one is which.

Then go to the network - wan - physical settings and disconnect eth0 (the non-working original WAN port, which is wired directly to the CPU) and connect eth1.2 (VLAN 2 of eth1) instead.  Change the LAN physical port from eth1 to eth1.1.   Nothing should be connected to plain eth1.

Thanks. It worked perfectly. I need one more help. My ISP has registered my Internet Connection with different MAC address. Now I want to use the MAC Clone feature. Everytime I log on the router I need to turn on SSH Command Line Client and use the following commands in order to get the connection link up.
ifconfig eth1.2 down
ifconfig eth1.2 hw ether XX:XX:XX:XX:XX:XX
ifconfig eth1.2 up
Someone suggested me to create a clonemac script and put it to the OpenWRT startup. I don't have any idea about creating and editing these init scripts.
Please suggest me some solution for this.

Network: Interfaces edit wan click Advanced enter the registered MAC in the "Override MAC Address" box.

(Last edited by mk24 on 26 Oct 2017, 20:04)

The override MAC address option is not available for PPPoE Connection Type. Please suggest a different solution.

Put option macaddr in /etc/config/network in wan section.

Thanks for the solution. I tried your solution, it worked fine for DHCP Connections but didn't worked for PPPoE connections. What I did is just placed the above code in the clonemac script and placed it to the startup which solved my problem.
Here is the script.

#!/bin/sh /etc/rc.common
# Copyright (C) 2014 OpenWrt.org

START=94
STOP=15

start() {
    ifconfig eth1 down
    ifconfig eth1 hw ether XX:XX:XX:XX:XX:XX
    ifconfig eth1 up
}

stop() {
    echo "Stop."
}

Hope this helps to others too.

The discussion might have continued from here.