Use LAN Port As WAN Port

Hi, I have the same issue as the OP in this post. I've setup lan port 1 on my Netgear DGN3500 with OpenWRT 19.07 as a wan port. However there's no internet connectivity. I don't know what I've done wrong if anything!? Can somebody please assist me with figuring out what might be the problem?

Are you familiar with SSH? If so could you print out the /etc/config/network file removing any sensitive data like the username and password and paste it between two code blocks please?

[code] & [/code]

3 Likes

Here you go. Hopefully I've captured everything required?

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.4, r11208-ce6496d796
 -----------------------------------------------------
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 'fdce:e1ed:87e7::/48'

config atm-bridge 'atm'
        option vpi '1'
        option vci '32'
        option encaps 'llc'
        option payload 'bridged'
        option nameprefix 'dsl'

config dsl 'dsl'
        option annex 'a'
        option firmware '/lib/firmware/adsl.bin'

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

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr '00:26:f2:3d:ac:f8'

config device 'wan_dsl0_dev'
        option name 'dsl0'
        option macaddr '00:26:f2:3d:ac:f9'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'
        option enable_vlan4k '1'
        option enable_learning '0'

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

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

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

root@OpenWrt:~#

Thank you for your help so far :slightly_smiling_face:

You need to specify gateway for the LAN interface.
And remove own IP from DNS to avoid looping.

1 Like

Replace the contents of /etc/network/ with the one below. I want to disclose that I can't guarantee this will work, so if locks you out you will have to factory reset. I have set one of the LAN ports to act as a WAN port using a thing called VLANs. This is represented by 'eth0.3'. '5t' is the CPU and '0-3' are the physical LAN ports. 'wwan' is taken up by 'eth0.2'z so I've left this as it is. WWAN is usually used for 3G/4G internet connectivity.

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 'fdce:e1ed:87e7::/48'

config atm-bridge 'atm'
        option vpi '1'
        option vci '32'
        option encaps 'llc'
        option payload 'bridged'
        option nameprefix 'dsl'

config dsl 'dsl'
        option annex 'a'
        option firmware '/lib/firmware/adsl.bin'

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

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr '00:26:f2:3d:ac:f8'

config device 'wan_dsl0_dev'
        option name 'dsl0'
        option macaddr '00:26:f2:3d:ac:f9'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'
        option enable_vlan4k '1'
        option enable_learning '0'

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

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

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

### WAN interface ###
config switch_vlan
        option device 'switch0'
        option ports '5t 0'
        option vlan '3'

config interface 'wan'
        option proto 'pppoe' # change depending how you're connecting
        option password 'password'
        option ipv6 'auto'
        option username 'user@domain.com'
        option mtu '1492'
        option ifname 'eth0.3'

Thanks for the replies guys :slightly_smiling_face: I cannot explain why, but it suddenly started working without changing anything!? Sorry to have wasted your time but thank you again for your assistance.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.