diff --git a/tmcd/freebsd/liblocsetup.pm b/tmcd/freebsd/liblocsetup.pm
index ef1efb0e4c5b9f6e4812f157c77c1f32923f36f8..f0547b5b26352e47c6a5ce2fb32f67eb497be09b 100644
--- a/tmcd/freebsd/liblocsetup.pm
+++ b/tmcd/freebsd/liblocsetup.pm
@@ -157,7 +157,17 @@ sub os_ifconfig_line($$$$$$;$)
 	$mediaopt = $IFC_FDUPLEX;
     }
 
-    $uplines   = sprintf($IFCONFIG, $iface, $inet, $mask, $media, $mediaopt);
+    $uplines = "";
+    
+    #
+    # Must set route table id before assigning IP address so that interface
+    # route winds up in the correct table.
+    #
+    if (defined($rtabid)) {
+	$uplines .= "$IFCONFIGBIN $iface rtabid $rtabid\n    ";
+    }
+
+    $uplines   .= sprintf($IFCONFIG, $iface, $inet, $mask, $media, $mediaopt);
     $downlines = "$IFCONFIGBIN $iface down\n";
 
     if ($aliases ne "") {