> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siderolabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Routing Rules

> How to configure Linux routing rules for the machine.

export const VersionWarningBanner = () => {
  const latestVersion = "v1.13";
  const [latestUrl, setLatestUrl] = useState(null);
  const [currentVersion, setCurrentVersion] = useState(null);
  const [isBeta, setIsBeta] = useState(false);
  const parseVersion = v => v.replace("v", "").split(".").map(Number);
  const isGreaterVersion = (a, b) => {
    const [aMajor, aMinor] = parseVersion(a);
    const [bMajor, bMinor] = parseVersion(b);
    if (aMajor > bMajor) return true;
    if (aMajor === bMajor && aMinor > bMinor) return true;
    return false;
  };
  useEffect(() => {
    if (typeof window === "undefined") return;
    const {pathname, hash, search} = window.location;
    const match = pathname.match(/\/talos\/(v\d+\.\d+)\//);
    if (!match) return;
    const detectedVersion = match[1];
    if (detectedVersion === latestVersion) return;
    setCurrentVersion(detectedVersion);
    if (isGreaterVersion(detectedVersion, latestVersion)) {
      setIsBeta(true);
    }
    const newPath = pathname.replace(`/talos/${detectedVersion}/`, `/talos/${latestVersion}/`);
    setLatestUrl(`${newPath}${search}${hash}`);
  }, []);
  if (!latestUrl || !currentVersion) return null;
  return <div className="not-prose sticky top-6 z-50 my-6">
      <div className="border border-yellow-500/30 bg-yellow-500/10 px-4 py-3 rounded-xl">
        <div className="text-sm">
          {isBeta ? <>
              ⚠️ You are viewing a <strong>beta version</strong> of Talos ({currentVersion}).
              This version may be unstable.
              <a href={latestUrl} className="ml-2 underline text-yellow-400 hover:text-yellow-300 font-medium">
                View latest stable version {latestVersion} →
              </a>
            </> : <>
              ⚠️ You are viewing an older version of Talos ({currentVersion}).
              <a href={latestUrl} className="ml-2 underline text-yellow-400 hover:text-yellow-300 font-medium">
                View the latest version {latestVersion} →
              </a>
            </>}
        </div>
      </div>
    </div>;
};

<VersionWarningBanner />

Routing rules are used to control the routing of network traffic on the machine based on various criteria such as source and destination addresses, interfaces, and more.
Routing rules are evaluated in order of priority, and the first matching rule is applied to the traffic.
This allows for complex routing configurations, such as policy-based routing, where traffic can be routed differently based on its characteristics.

By default, a predefined routing table main is used for all traffic, but additional routing tables can be created and used with routing rules to achieve more granular control over traffic routing.

Routing rules can be configured in Talos Linux using the [`RoutingRuleConfig`](../../reference/configuration/network/routingruleconfig) machine configuration document:

```yaml theme={null}
apiVersion: v1alpha1
kind: RoutingRuleConfig
name: "1000"
src: 10.0.0.0/8
table: "100"
action: unicast
```

The `name` field specifies the priority of the routing rule, with lower numbers having higher priority.
The priority must be a number between 1 and 32764, where 1 is the highest priority and 32764 is the lowest priority.
Priorities 0, 32765, and 32766 are reserved for special use by the system and cannot be used for custom routing rules.

Once the routing rule is applied, any traffic with a source address in the `10.0.0.0/8` subnet will be routed according to the routing table `100` instead of the default `main` routing table, and the action `unicast` specifies that the traffic should be routed normally
(as opposed to being dropped or sent to a specific interface).

Routes in the routing table can be populated using static routes as shown in [static link configuration](./../configuration/static) by specifying the `table:` field (which defaults to `main`).
