#!/bin/bash

CONFIG="$1"
if [ "x$1" != x -a "x$1" != "x-o" ] ; then
    INTERFACE="$1"
else
    INTERFACE="$CONFIG"
fi

if [ $INTERFACE == "eth0"] ; then
# CUSTOMER_1 NETWORK
ip rule add from 172.20.0.0/17 table CUSTOMER_1
ip rule add to 172.20.0.0/17 table CUSTOMER_1

elif [ $INTERFACE == "eth1"] ; then
# CUSTOMER_2 NETWORK
ip rule add from 172.20.128.0/17 table CUSTOMER_2
ip rule add to 172.20.128.0/17 table CUSTOMER_2

fi