This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Manual Network Route
#1
Hey Guys,

Is it possible top add a Network Route manually?
Reply
#2
Code:
os.execute('route add ...')
For routes to persist between reboots add your code to the init script.
Reply
#3
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?
Reply
#4
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.
Reply
#5
It works! Big Grin 

Thanks
Reply


Forum Jump: