Skip to content

feat(linux): set/unset urunit environment variable for default route#284

Merged
urunc-bot[bot] merged 1 commit into
mainfrom
set_urunit_env_for_gateway
Sep 23, 2025
Merged

feat(linux): set/unset urunit environment variable for default route#284
urunc-bot[bot] merged 1 commit into
mainfrom
set_urunit_env_for_gateway

Conversation

@cmainas

@cmainas cmainas commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

In the case of Linux guests, urunit by default used to set as the default route the eth0 interface. However, this was creating issues with docker and nerdctl, where the container could not reach the outside network. Nevertheless, this was required in k8s set ups, since the IP of the container could be in a different subnet than the gateway and the Linux kernel can not handle such network configuration.

To fix the above, use a specific environment variable for urunit, called URUNIT_DEFROUTE, which urunc sets it only when the IP of the container is in a different subnet than the gateway. Otherwise urunc will not set it. From urunit's side, if the environment variable is set, then it will use the eth0 interface as the default route.

@netlify

netlify Bot commented Sep 19, 2025

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 06f169c
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/68d29828962b7500082fa768

@cmainas cmainas force-pushed the set_urunit_env_for_gateway branch 3 times, most recently from 3205c22 to fa5263d Compare September 22, 2025 11:53
@cmainas cmainas marked this pull request as ready for review September 22, 2025 12:08
@cmainas cmainas requested review from ananos and gntouts September 22, 2025 12:08

@ananos ananos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cmainas

In the case of Linux guests, urunit by default used to set as the
default route the eth0 interface. However, this was creating issues with
docker and nerdctl, where the container could not reach the outside
network. Nevertheless, this was required in k8s set ups, since the IP of
the container could be in a different subnet than the gateway and the
Linux kernel can not handle such network configuration.

To fix the above, use a specific environment variable for urunit, called
`URUNIT_DEFROUTE`, which urunc sets it only when the IP of the container
is in a different subnet than the gateway. Otherwise urunc will not set
it. From urunit's side, if the environment variable is set, then it will
use the eth0 interface as the default route.

PR: #284
Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk>
Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
@github-actions github-actions Bot force-pushed the set_urunit_env_for_gateway branch from fa5263d to 06f169c Compare September 23, 2025 12:52
@urunc-bot urunc-bot Bot merged commit 9e7b975 into main Sep 23, 2025
3 of 5 checks passed
@sonarqubecloud

Copy link
Copy Markdown

@cmainas cmainas deleted the set_urunit_env_for_gateway branch September 23, 2025 13:50
panosmaurikos pushed a commit to panosmaurikos/urunc that referenced this pull request Sep 30, 2025
In the case of Linux guests, urunit by default used to set as the
default route the eth0 interface. However, this was creating issues with
docker and nerdctl, where the container could not reach the outside
network. Nevertheless, this was required in k8s set ups, since the IP of
the container could be in a different subnet than the gateway and the
Linux kernel can not handle such network configuration.

To fix the above, use a specific environment variable for urunit, called
`URUNIT_DEFROUTE`, which urunc sets it only when the IP of the container
is in a different subnet than the gateway. Otherwise urunc will not set
it. From urunit's side, if the environment variable is set, then it will
use the eth0 interface as the default route.

PR: urunc-dev#284
Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk>
Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
codesmith25103 pushed a commit to codesmith25103/urunc that referenced this pull request Oct 2, 2025
In the case of Linux guests, urunit by default used to set as the
default route the eth0 interface. However, this was creating issues with
docker and nerdctl, where the container could not reach the outside
network. Nevertheless, this was required in k8s set ups, since the IP of
the container could be in a different subnet than the gateway and the
Linux kernel can not handle such network configuration.

To fix the above, use a specific environment variable for urunit, called
`URUNIT_DEFROUTE`, which urunc sets it only when the IP of the container
is in a different subnet than the gateway. Otherwise urunc will not set
it. From urunit's side, if the environment variable is set, then it will
use the eth0 interface as the default route.

PR: urunc-dev#284
Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Reviewed-by: Anastassios Nanos <ananos@nubificus.co.uk>
Approved-by: Anastassios Nanos <ananos@nubificus.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants