WAN to LAN help

Hi guys,
I'm new to this project.
My Mi Router 3G was struck by power surge and WAN post has gone.
I installed LEDE but dont have any idea for to make one of the LAN ports to WAN...
Please help.
Here is my configuration:


root@OpenWrt:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r7161-c8677ca'
DISTRIB_TARGET='ramips/mt7621'
DISTRIB_ARCH='mipsel_24kc'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r7161-c8677ca'
DISTRIB_TAINTS=''
root@OpenWrt:~# cat /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 'fd00:5320:ad33::/48'

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

config device 'lan_dev'
        option name 'eth0.1'
        option macaddr '34:ce:00:64:8d:b8'

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

config interface 'wan6'
        option ifname 'eth0.2'
        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 '2 3 6t'

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

Just change these lines:

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

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

To these:

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

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

And now your LAN-2 port should be the WAN port.

1 Like

Hi eduperez,
Thank you so much for the help.
I'm really noob in openwrt.
I can say that now partial works.
For test I connected the router to my current router.
I found that my phone connects to 5G and gets IP from the main router (192.168.31.x) and all is OK.
But when I connect my PC (doesnt have 5G WiFi card) it gets IP 192.168.1.x.
It's not problem for now because I can manually add IP but it's strange.
The other issue I found is I no longer able to login via SSH (connection refused) after first reboot.
Maybe I need to set SSH daemon or something?
And finally where should I set MAC address of WAN so i can access internet from my provider?
Hers?

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '3 6t
        option macaddr 'XX:XX:XX:XX:XX:XX'

Thank you!

Did you use the wrong lan port for your wan?
Why do you want to connect your second routers wan to your main routers lan? Double nat is not that good...

Mac address should be set on the interface wan/wan6 and not the switch config part.

Hi,
I just wanted to test is the LAN port swapped to WAN, thats why I connected to the main router.
Without changing MAC cant directly access internet.
Anyway I need first to solve SSH access problem because I can access the router anymore w/o master reset.

You need a ip in subnet 192.168.1.X and connected to a lan port of your openwrt router.

If this will not work:
entering_failsafe_mode

Hi juppin,
Thank for the failsafe hint.
I found that dropbear config was corrupted so i fixed it.
Now i can connect trough SSH.
But i discovered another issue.
Not sure what mode is set but client connects via wireless gets IP directly from Internet provider instead from router.
It looks like router is bypassed and internet provider sees client MAC instead of router MAC.
Here is my wireless config:

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode 'HT20'
        option disabled '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option channel '36'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:01.0/0000:02:00.0'
        option htmode 'VHT80'
        option disabled '0'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

Edit:
I was manage to obtain IP from internet provider.
And even installed LuCi but no internet sharing trough LAN or Wireless :((
Any idea?

Please post the content of /etc/config/network and the output of ifconfig

Hi,
I handled it.
Needed to add firewalls rules.
Now all looks ok.
Thank you guys!