Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Rpi zero usb ethernet to pfsense

    Scheduled Pinned Locked Moved General pfSense Questions
    31 Posts 3 Posters 5.6k Views
    Loading More Posts
    • 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.
    • X
      xbipin
      last edited by

      Well this is raspberry pi so maybe the code is different to Nexus 4.

      I can try it in freebsd directly but that patch provided isn't in the release so how do I add that and recompile and test, any guide would be helpful as I'm a beginner to this.

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        It's been a while but as I recall it should be pretty straight forward.

        Bring up a FreeBSD 10.3 VM (or a real machine, whatever) and include the source code during the install.

        Edit the five lines into the code at /usr/src/sys/dev/usb/net/if_urndis.c. It's only 5 lines so you can probably just edit them in manually or fetch and merge the .diff file.

        Then go to: /usr/src/sys/modules/usb/urndis and run: make

        The new modules should appear in that folder. You can sftp it out and into pfSense as you did with the original module.

        Steve

        1 Reply Last reply Reply Quote 0
        • X
          xbipin
          last edited by

          thanks for the help, which location do i copy this module in pfsense or do i need to copy anywhere and add an entry to load it on boot?

          1 Reply Last reply Reply Quote 0
          • X
            xbipin
            last edited by

            i loaded up freebsd 11 in VM then added the patch and compiled and the resulting if_rndis.ko file i copied over to pfsense and loaded it on boot using the loader.conf file but im still seeing the same behavior

            Enter an option: ugen0.2: <linux 4.9.37+="" with="" 20980000.usb=""> at usbus0
            cdce0: <rndis communications="" control=""> on usbus0
            cdce0: No valid alternate setting found
            device_attach: cdce0 attach returned 6
            cdce0: <rndis ethernet="" data=""> on usbus0
            cdce0: faking MAC address
            ue0: <usb ethernet=""> on cdce0
            ue0: Ethernet address: 2a:c9:1a:f8:7f:00</usb></rndis></rndis></linux>
            

            to check if the module i loaded from pfsense shell i typed kldload /boot/modules/if_urndis.ko and it says

            kldload: can't load /boot/modules/if_urndis.ko: module already loaded or in kern
            el
            

            so im a bit confused if my compiled ko is being used or the in kernel one in pfsense, if u think the above is correct shall i report it to the dev on freebsd that the patch doesnt work?

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              The if_urnidis kernel module is not included with pfSense either in the kernel or as a loadable module so if you are seeing that it means you have copied it across to the correct place (/boot/modules) and loaded it correctly at boot time with a line in loader.conf.local.

              If that was the module created with the patched code rather than whatever you had there before then it looks like the patch did not work.

              It still concerns me that the device created is cdce0 and not urndis0. It looks to me as though it's not even using the urndis driver. What happens if you remove the module entirely and boot without it?

              Steve

              1 Reply Last reply Reply Quote 0
              • X
                xbipin
                last edited by

                i have no other module installed, as per ur instructions i added that patch and ran make and it gave me this id_urndis.ko file which i copied over to pfsense and loaded it at boot.

                do u mean remove the rpi and boot pfsense, its same if i plug rpi when pfsense is running or keep rpi running and boot pfsense. the usbconfig etc commands give same output with and without the if_urndis.ko file loaded.

                i updated the thread at freebsd bugzilla, ill mentioned ur point about its not using the rndis driver there

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  Ah, well if it does the same thing without any urndis module present then clearly it's not using that at all just the cdce driver which is in kernel in pfSense.

                  So patching urndis ain't gonna do anything.  ;)

                  I've seen exactly that same issue with cdce.

                  Wow, long time ago! https://forum.pfsense.org/index.php?topic=26563.0

                  No change.  ::)

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • X
                    xbipin
                    last edited by

                    yes i read that thread sometime back but is there any way to load the urndis driver and make the kernel use that?

                    1 Reply Last reply Reply Quote 0
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      If the presented USB vendor and product IDs are registered by cdce(4) then the kernel will try to use that driver.

                      As I understand it the urndis driver will try to attach to anything presenting as an rndis device so it might attach if cdce was not in kernel. I'm not sure there's any way to unload it short of re-compiling the kernel without it.

                      Steve

                      1 Reply Last reply Reply Quote 0
                      • X
                        xbipin
                        last edited by

                        ok so for now it means no way to solve this

                        1 Reply Last reply Reply Quote 0
                        • stephenw10S
                          stephenw10 Netgate Administrator
                          last edited by

                          Unfortunately I think that's true. It would need to be something from upstream anyway.

                          I have no idea where that device even is I was testing with anymore.  ;)

                          Steve

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.