Logic Machine Forum
Manual Network Route - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: Manual Network Route (/showthread.php?tid=4785)



Manual Network Route - The Real Mr.T - 25.05.2023

Hey Guys,

Is it possible top add a Network Route manually?


RE: Manual Network Route - admin - 25.05.2023

Code:
os.execute('route add ...')
For routes to persist between reboots add your code to the init script.


RE: Manual Network Route - The Real Mr.T - 26.05.2023

Thanks Admin,

But not working yet.

I try:
os.execute('ip route add 192.168.101.0/24 via 172.16.87.150')
os.execute('ip route add 192.168.101.0 netmask 255.255.255.0 gw 172.16.87.150 eth0')

No script errors loged.
If the Route is added will it be shown in the Route window?

Im Using Schneider Spacelynk maybe this is the reason?


RE: Manual Network Route - admin - 26.05.2023

Try this:
Code:
res = io.readproc('route add -net 192.168.101.0/24 gw 172.16.87.150 eth0 2>&1')
log(res)
You might also need to disable "Block unsafe functions in scripts" in Utilities > General configuration.


RE: Manual Network Route - The Real Mr.T - 30.05.2023

It works! Big Grin 

Thanks