Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

BSD Cafe Billboard

  1. Home
  2. BSD
  3. FreeBSD
  4. Wireguard in a Bastille jail - getting if_wg_load to work?

Wireguard in a Bastille jail - getting if_wg_load to work?

Scheduled Pinned Locked Moved FreeBSD
3 Posts 1 Posters 57 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yetiinabox
    wrote last edited by
    #1

    Gentlefolk,

    I am trying to set up a wireguard client inside a Bastille jail - both the host and the jail are on FreeBSD 15.1.

    I have encountered an error (SIOCIFCREATE2 (wg0): Invalid argument) when I try to bring up the interface.

    Apparently this is because, while the host system has access to the kernel module that enables wireguard, the jail does not.

    After a bit of research, it seems that the way to handle this is to put the declaration
    if_wg_load="YES"
    into /boot/loader.conf, or perhaps into a file inside /boot/loader.conf.d.

    However, Bastille sets up /boot as a read-only filesystem.

    Hence the only way I can see to fix this is to edit the fstab for this jail and change the flags for /boot to rw from ro, restart the jail, edit the necessary files, and then go back out to the host and reset the flags in fstab.

    Now, call me an optimist, but I suspect the good folks behind Bastille will already have seen this problem and worked out a less awkward solution - I just can't find it anywhere. Am I missing something?

    Many thanks as ever,

    ---WBTD.

    Y 1 Reply Last reply
    1
    • Y yetiinabox

      Gentlefolk,

      I am trying to set up a wireguard client inside a Bastille jail - both the host and the jail are on FreeBSD 15.1.

      I have encountered an error (SIOCIFCREATE2 (wg0): Invalid argument) when I try to bring up the interface.

      Apparently this is because, while the host system has access to the kernel module that enables wireguard, the jail does not.

      After a bit of research, it seems that the way to handle this is to put the declaration
      if_wg_load="YES"
      into /boot/loader.conf, or perhaps into a file inside /boot/loader.conf.d.

      However, Bastille sets up /boot as a read-only filesystem.

      Hence the only way I can see to fix this is to edit the fstab for this jail and change the flags for /boot to rw from ro, restart the jail, edit the necessary files, and then go back out to the host and reset the flags in fstab.

      Now, call me an optimist, but I suspect the good folks behind Bastille will already have seen this problem and worked out a less awkward solution - I just can't find it anywhere. Am I missing something?

      Many thanks as ever,

      ---WBTD.

      Y Offline
      Y Offline
      yetiinabox
      wrote last edited by
      #2

      <sigh/> The awkward solution does not appear to work, either. Any suggestions?

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yetiinabox
        wrote last edited by
        #3

        ...and it was an idiot error. I had to enable wg in the host kernel. I knew it was built into the kernel these days...I just hadn't realised I needed to enable it. -->facepalm<--

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        Powered by NodeBB Contributors
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups