Mt300n 'network' not work on ar150

I don’t know anything about networking, only that I was using a mt300n router and now have to set up ar150 but ‘network’ file from mt300n not working anymore. Could someone please convert this file for me to one that will work on ar150.

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

config interface ‘wan’
option ifname ‘eth0.1 eth0.2’
option force_link ‘1’
option type ‘bridge’
option proto ‘dhcp’

config interface ‘lan’
option ifname ‘br-wan’
option proto ‘static’
option ipaddr ‘192.168.10.5’
option netmask ‘255.255.0.0’

config interface ‘wwan’
option proto ‘dhcp’

config switch
option name ‘switch0’
option reset ‘1’
option enable_vlan ‘1’

config switch_vlan
option device ‘switch0’
option vlan ‘2’
option ports ‘0 6t’

config switch_vlan
option device ‘switch0’
option vlan ‘1’
option ports ‘1 2 3 4 6t’

config interface ‘PIA_VPN’
option proto ‘none’
option ifname ‘tun0’

I cannot even get the router to get a dhcp ip and of course, cannot get to the vpn server I need to get to. I do not have any clue how to change this to make it ar150 compatible. I must use the same type of ‘network’ or other things will break that were set up for me.

Help!

You cannot use the config in MT300N on AR150 because network devices are not the same.

What do you want to do? Can you just do using the UI or Luci?

Here are some thing you need to correct:

config interface 'wan’
option ifname 'eth0’
option force_link '1’
option type 'bridge’
option proto ‘dhcp’

config interface 'lan’
option ifname 'br-lan’

The the following should be removed

config switch
option name 'switch0’
option reset '1’
option enable_vlan ‘1’

config switch_vlan
option device 'switch0’
option vlan '2’
option ports ‘0 6t’

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

It’s impossible to use the same network configuration file, even if you configure switch, due to cpu port is different.

I think I understand this but can it be done in another way?

I am asking if someone could convert the previous network file to what ever I will need for this new network file. Someone else originally did it for me and I do not know how.

Lets make it simple then.

I am needing the LAN dhcp and bridge the WAN for pass-through for example.
I also want to enable the wifi and have the luci interface for configuring the wlan. I will also add a PIA_VPN interface.

I am now using the following;

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 ‘fdef:b66e:7711::/48’

config interface ‘lan’
option ifname ‘eth1’
option force_link ‘1’
option type ‘bridge’
option proto ‘dhcp’

config interface ‘wan’
option ifname ‘eth0’
option proto ‘dhcp’
option hostname ‘GL-AR150-343’

config interface ‘wwan’
option proto ‘dhcp’

config interface ‘PIA_VPN’
option proto ‘none’
option ifname ‘tun0’

This is giving me the following;

br-lan Link encap:Ethernet HWaddr E4:95:6E:44:A3:43
inet addr:192.168.1.212 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::e695:6eff:fe44:a343%eth0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22323 errors:0 dropped:0 overruns:0 frame:0
TX packets:20760 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4130130 (3.9 MiB) TX bytes:1965266 (1.8 MiB)

eth0 Link encap:Ethernet HWaddr E4:95:6E:44:A3:43
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:4

eth1 Link encap:Ethernet HWaddr E4:95:6E:44:A3:43
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23548 errors:0 dropped:71 overruns:0 frame:0
TX packets:20753 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4580172 (4.3 MiB) TX bytes:1964032 (1.8 MiB)
Interrupt:5

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1%2/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:216 errors:0 dropped:0 overruns:0 frame:0
TX packets:216 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16104 (15.7 KiB) TX bytes:16104 (15.7 KiB)

It’s okay, you can try overide network configuration file with the following lines:

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 'fdef:b66e:7711::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'br-wan'
	option proto 'static'
	option netmask '255.255.0.0'
	option ipaddr '192.168.10.5'

config interface 'wan'
	option type 'bridge'
	option ifname 'eth0 eth1'
	option proto 'dhcp'
	option force_link '1'

config interface 'wwan'
	option proto 'dhcp'
	option metric '20'

config interface 'PIA_VPN'
	option proto 'none'
	option ifname 'tun0'

Thank you very much, this worked perfectly.

One question…

Is it correct to include the following in the network file? This to me seems to be specific to a device and not something that should be copied to a different one.

config globals ‘globals’
option ula_prefix ‘fdef:b66e:7711::/48’

If you don’t use ipv6, it can be ignored. Or you can keep the original value, what I mean you don’t need copy it.

Just wondering, s the code the same on all of the same models or is it unique on each device?