#!/bin/sh tables="mts-azov rt-azov mts-il" net= case "$ACTION" in ifup) case "$INTERFACE" in eth2) net=192.168.7 ;; eth3) net=192.168.8 ;; esac if [ -z "$net" ]; then exit; fi for t in $tables; do ip r add ${net}.0/24 via ${net}.1 table $t done ;; esac