I'm trying to run a script that should add this route to a table 11:
ip route add local 10.1.3.212 dev eth1 proto kernel scope host src 10.1.3.212 table 11
If I run this command manually, it is successful and I can see the entry in table 11 but if I run a script that does the following:
if [[ ${IP_ROUTE} == local* ]]; then
ip route add ${IP_ROUTE} table ${NEW_INTERFACE_TABLE} 2>>/home/ec2-user/script_output
fi
where ${NEW_INTERFACE_TABLE} is 11 the script throws this error:
Error: an inet prefix is expected rather than "local 10.1.3.212 dev eth1 proto kernel scope host src 10.1.3.212 ".
Please help, I'm going nuts.