You are not logged in.

#1 2014-01-18 13:23:25

lazork
Member
Registered: 2008-11-12
Posts: 30

netctl and ip rules

I'm trying to set up a custom rule:

ip rule add from 192.168.0.0/24 iif eth0 table mytablename

The table 'mytablename' exists and the command correctly creates the rule when I execute it.

Now, I'd like to automate the execution of this command so that I don't have to retype it every time I restart my system.
I'm using netctl, so I've tried editing the connection that this rule is related to. I've tried adding either

ExecUpPost='ip rule add from 192.168.0.0/24 iif eth0 table mytablename'

or

IPCustom=('rule add from 192.168.0.0/24 iif eth0 table mytablename')

but none of the two works; 'ip rule list' only shows:

0:	from all lookup local 
32766:	from all lookup main 
32767:	from all lookup default

I'm managing profiles by starting the service netctl-auto@wlan0 (yes, the different interface is correct).
The connection is correctly created, but I still need to manually call 'ip rule add ...'
How can I automate this?

Offline

Board footer

Powered by FluxBB