Commit b6de1d3a authored by Leigh Stoller's avatar Leigh Stoller

Another crack at routing.

Note that route table selection is bogus and will need to be fixed
after the GEC.
parent 93f66786
......@@ -1325,6 +1325,7 @@ sub vz_vnodePreConfigExpNetwork {
}
my %key2gre = ();
my $maxgre = 0;
my $table = $vmid + 100;
while (<IP>) {
if ($_ =~ /^(gre\d*):.*key\s*([\d\.]*)/) {
......@@ -1392,7 +1393,7 @@ sub vz_vnodePreConfigExpNetwork {
return -1;
}
my $net = inet_ntoa(inet_aton($inetip) & inet_aton($mask));
mysystem2("/sbin/ip route replace $net/24 dev $gre table $vmid");
mysystem2("/sbin/ip route replace default dev $gre table $table");
if ($?) {
TBScriptUnlock();
return -1;
......
......@@ -92,10 +92,11 @@ echo "$ELABROUTES" | sed -e 's/;/\n/g' | \
do \
_if=`echo "$route" | sed -r -e 's/([^,]*),[^,]*,[^,]*/\1/'`
_rt=`echo "$route" | sed -r -e 's/[^,]*,([^,]*),[^,]*/\1/'`
_tb=`expr $VEID + 100`
if [ $_if = $DEV ]; then
echo "Emulab configuring route for CT$VEID: exp net ($_if)"
$IP rule add unicast iif $_if table $VEID
$IP rule add unicast iif $_if table $_tb
$IP route replace $_rt dev $_if table $VEID
fi
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment