Changing default route

Language, region, time zone, power, navigation, notification and more.
Locked
User avatar
Moetop
Posts: 5
Joined: 29 Jan 2021, 06:12

Changing default route

Post by Moetop »

I have added a wireless adapter, and would like to keep both wired and wireless connections (One leg in in the main network and the wireless is in another network), but I want to make the wireless connection the default route. I can add the Wireless card as a default (0.0.0.0) route and delete the wireed connection default route entry, via TErminal session, but after reboot that goes away and the wired connection is default again. I have also edited the /etc/network/interfaces to set the wireless as default to true, and the wired as default to false, but after reboot it reverts back.

What is the best way to do what I want. Is there a startup script that I can run, that will actually save?

Any ideas are greatly appreciated. I want the 192.168.8.1 gateway to be the default and survive a reboot. (see below)

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.200.1   0.0.0.0         UG    0      0        0 eth0
192.168.8.0     0.0.0.0         255.255.255.0   U     1      0        0 wlan0
192.168.200.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
User avatar
TMRyan
TerraMaster Team
Posts: 829
Joined: 01 Dec 2020, 11:50
China

Re: Changing default route

Post by TMRyan »

Sorry,
This is because TNAS will not automatically connect to the wireless network after restarting the device.
We have resolved this issue and will add it to the new version.
To contact our team, please send email to following addresses, remember to replace (at) with @
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement)
User avatar
Moetop
Posts: 5
Joined: 29 Jan 2021, 06:12

Re: Changing default route

Post by Moetop »

i'm not following you.. The wireless works fine It shows an IP address, and I can ping, and manage through the web interface via that IP address. I just want to set the default route to the wireless, BUT I do want BOTH connections. How would the new version resolve this issue and when will it be available? See below

--------From the TNAS ------
root@TNAS-AAF5:~# ifconfig
eth0 Link encap:Ethernet HWaddr 6C:BF:B5:01:AA:F5
inet addr:192.168.200.251 Bcast:192.168.200.255 Mask:255.255.255.0
inet6 addr: fe80::6ebf:b5ff:fe01:aaf5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1583802 errors:0 dropped:36 overruns:0 frame:0
TX packets:70276 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:331741345 (316.3 MiB) TX bytes:24596037 (23.4 MiB)
Interrupt:12

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:14945 errors:0 dropped:0 overruns:0 frame:0
TX packets:14945 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:2051924 (1.9 MiB) TX bytes:2051924 (1.9 MiB)

wlan0 Link encap:Ethernet HWaddr 1C:BF:CE:59:91:E9
inet addr:192.168.8.104 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::1ebf:ceff:fe59:91e9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:133772 errors:0 dropped:515 overruns:0 frame:0
TX packets:10043 errors:0 dropped:4 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13951045 (13.3 MiB) TX bytes:1410572 (1.3 MiB)
------------
------ From the PC on the same network segment
C:\Users\moetop>ping 192.168.8.104

Pinging 192.168.8.104 with 32 bytes of data:
Reply from 192.168.8.104: bytes=32 time=11ms TTL=64
Reply from 192.168.8.104: bytes=32 time=28ms TTL=64
Reply from 192.168.8.104: bytes=32 time=7ms TTL=64
Reply from 192.168.8.104: bytes=32 time=44ms TTL=64

------------------
--------From the Tnas /etc/network/interfaces 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'
option proto 'dhcp'
option ipaddr '10.18.13.58'
option netmask '255.255.255.0'
option gateway '10.18.13.1'
option dns '8.8.8.8'
option defaultroute 'false'
option dns2 '192.168.200.1'
option dns1 '8.8.8.8'

config interface 'wlan'
option ifname 'wlan0'
option proto 'dhcp'
option ipaddr '10.18.13.47'
option netmask '255.255.255.0'
option gateway '10.18.13.1'
option dns '8.8.8.8'
option defaultroute 'true'
option dns1 '192.168.8.1'

config interface 'guest'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
option _orig_ifname 'wlan1-1'
option _orig_bridge 'false'

~-------------
----------On the Tnas the route shows this
root@TNAS-AAF5:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.200.1 0.0.0.0 UG 0 0 0 eth0
192.168.8.0 0.0.0.0 255.255.255.0 U 1 0 0 wlan0
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


---------------
---------- on the Tnas if I run the route commands it will change the default route.

root@TNAS-AAF5:~# route add default gw 192.168.8.1 wlan0
root@TNAS-AAF5:~# route delete default gw 192.168.200.1
root@TNAS-AAF5:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.8.1 0.0.0.0 UG 0 0 0 wlan0
192.168.8.0 0.0.0.0 255.255.255.0 U 1 0 0 wlan0
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
User avatar
TMRyan
TerraMaster Team
Posts: 829
Joined: 01 Dec 2020, 11:50
China

Re: Changing default route

Post by TMRyan »

Hello,
TNAS only supports one gateway for the time being. Even if you are connected to both, you can only use one network.
I'm not sure when a version to solve this problem will be released. You need to be able to manually set the default gateway temporarily after restarting.
In fact, you can go to Control Panel>>Network Settings>>Network Interface>>Service Sequence and modify WiFi as the first order, which will set the WiFi gateway as the default gateway.
wifi.png
To contact our team, please send email to following addresses, remember to replace (at) with @
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement)
User avatar
Moetop
Posts: 5
Joined: 29 Jan 2021, 06:12

Re: Changing default route

Post by Moetop »

I didn't know that was there and is exactly what I need (I just want 1 default route), but it doesn't save between reboots (This is an F2-210) I hit the arrow moving it up, hit apply (as your picture shows) and after reboot it goes back to the Lan 1 being at the top. just to make sure I didn't mess something up by trying to edit these settings manually, I did a factory reset to defaults, and set this on a clean install.

It does initially set it, but it does not survive the reboot. See below

------------------
----------After setting it as you showed.
root@TNAS-AAF5:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.8.1 0.0.0.0 UG 0 0 0 wlan0
192.168.8.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
root@TNAS-AAF5:~#


---------
-----After setting it as you showed and then a reboot.
root@TNAS-AAF5:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.200.1 0.0.0.0 UG 0 0 0 eth0
192.168.8.0 0.0.0.0 255.255.255.0 U 1 0 0 wlan0
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
User avatar
Moetop
Posts: 5
Joined: 29 Jan 2021, 06:12

Re: Changing default route

Post by Moetop »

NOTE... It now >>>works<<< instead of setting the order in the service sequence, I edited the Wi-Fi1 connection and checked "set as default gateway" then I looked under the service sequence and the Wireless adapter was first, For safety sake I hit apply there (without changes in that screen) rebooted and now that interface is maintained as the default route..

One last question, Are there any Wired ethernet USB adapters that will work with the NAS? I would prefer a ethernet cable, but what I have now will work.

Thanks for your help!!
User avatar
TMRyan
TerraMaster Team
Posts: 829
Joined: 01 Dec 2020, 11:50
China

Re: Changing default route

Post by TMRyan »

Hello,
For the time being, we do not support wired usb adapters.
By the way, why do you need it?
To contact our team, please send email to following addresses, remember to replace (at) with @
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement)
User avatar
Moetop
Posts: 5
Joined: 29 Jan 2021, 06:12

Re: Changing default route

Post by Moetop »

TMRyan wrote: 03 Feb 2021, 11:29 Hello,
For the time being, we do not support wired usb adapters.
By the way, why do you need it?
I have 2 separate networks. One that has a router that goes through a VPN, and another that does not. I want to use the VPN router as my default route to the internet just for the terrastation, but also want to maintain a leg in the main network so I can access the files locally. Both being wired Gigabit would be nice, but I can deal with the wireless for VPN/internet access. Less wireless signals I can have the better.

In a corporate network something similar might be a server in the DMZ where limited/controlled/vpn connectivity would be through one interface, and corporate access might be through another.
Locked

Return to “System Configuration”