# /dev/bpf is not present



## aurora (Dec 9, 2009)

Hello,

I want to enable DCHPserver on my FreeBSD and now look for the device called "bpf" (Berkeley Packet Filter) to see if it's already installed in my system.

I don't know if my kernel is currently a custom kernel; as far as I remember, I had rebuilt it to introduce an NDIS Wireless driver and put _ndis_load="YES"_ and several other related expressions into _/boot/loader.conf_. 

*ls /dev | grep bpf* returns nothing, does that mean there's no bpf in my system? I think so. So I guess I have to install "bpf" on my system, i.e. rebuild the kernel with the "device bpf" option.

Here is my question:

FreeBSD handbook talks about rebuilding kernel using _/usr/src/sys/i386/conf/*GENERIC*_ as the guiding file. And one look into GENERIC shows "device bpf" is there uncommented (no # at the start) which makes me think my kernel is already built with "device bpf", is that right?  Should I still rebuild the kernel using that GENERIC file, in order to make "device bpf" compiled into it? 

Thanks.


----------



## graudeejs (Dec 9, 2009)

if you don't have /deb/bpf you have custom kernel
show output of `$ uname -a`


----------



## aurora (Dec 9, 2009)

uname -a returns:
FreeBSD IBM.HOME.COM 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 08:49:13 UTC 2009    root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386

/usr/obj/usr/src/sys/*GENERIC*

Does the GENERIC at the end mean that it's a GENERIC system?


----------



## SirDice (Dec 9, 2009)

aurora72 said:
			
		

> uname -a returns:
> FreeBSD IBM.HOME.COM 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 08:49:13 UTC 2009    root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
> 
> /usr/obj/usr/src/sys/*GENERIC*
> ...



No, it means you've built a kernel with the config file GENERIC. Now, unless you've modified the original GENERIC kernel config (seriously not advised) you are running a GENERIC kernel. But because you don't seem to have bpf devices I have a feeling you edited the GENERIC config. This is why you should _copy_ the GENERIC config before changing anything. Change the name to MYKERNEL i.e. and change the ident inside it.


----------



## aurora (Dec 9, 2009)

As far as the ident is concerned, there's this line in /usr/src/sys/i386/conf/GENERIC :

*ident GENERIC*

Sorry but, change this ident to what? Uncomment with # or delete it? And, after I rename this GENERIC file to e.g. MYKERNEL, shall I carry out the rebuild&reinstall kernel job to have the bpf device?

Thanks


----------



## SirDice (Dec 9, 2009)

First make sure the GENERIC is still the original one. Device bpf should be at the bottom somewhere.

If you need to compile a custom kernel copy GENERIC to MYKERNEL i.e. and edit MYKERNEL. At the ident line change GENERIC to MYKERNEL (so it reflects the name of the file). Edit what you need in/out.

Compiling/installing is done with

```
make buildkernel KERNCONF=MYKERNEL
make installkernel KERNCONF=MYKERNEL
```
If you are only changing your kernel there's no need to do an installworld.


----------



## aurora (Dec 9, 2009)

Alright, I will start applying all these info, after I return from shopping and get back home...


----------



## aurora (Dec 9, 2009)

I've applied it (At the ident line changing GENERIC to MYKERNEL and other steps OK) but at the 

`# make buildkernel KERNCONF=MYKERNEL`

step after a long build it ended up with


```
Stop in /usr/obj/usr/src/sys/MYKERNEL.
*** Error code 1

Stop in /usr/src.
*** Error code 1
```

How to proceed in this case? I haven't done any installation yet.


----------



## SirDice (Dec 9, 2009)

Please post the messages leading up to the error. This just tells us the build stopped, not the why.


----------



## aurora (Dec 9, 2009)

That's the point where the build has stopped. Btw, I couldn't copy&paste those output from xterm, so I had to load that image.


----------



## graudeejs (Dec 9, 2009)

Select... and then in forum click middle mouse button or shift+insert, would paste it


----------



## aurora (Dec 10, 2009)

killasmurf86 said:
			
		

> if you don't have /deb/bpf you have custom kernel
> show output of `$ uname -a`



I guess I really have a GENERIC kernel because the only operation I had done relating the kernel was just adding a Kernel Loadable Module (LKM, you call it).


----------



## akeiron (Dec 17, 2009)

*devfs or MAKEDEV*

I was having the same problem here, and it was due to the fact I accidentally removed the following line from rc.conf

```
dhcpd_devfs_enable="YES"
```

I guess uou could also try
kldload ng-bpf
(note this is a lucky guess because I'm new to freeBSD).

However, in my case, it still complains at boot-time that it "cannot start dhcpd" because "the interface is already in use", which is weird: in fact the interface is not in use, of course, and the dhcp server is working correctly since new hosts receive an ip address from that host, which is a minimal installation of freeBSD in vmware-server-1.0.9. I'm running two freeBSD virtual machines at the moment on a linux box: might that be the issue here?
I'm confused. This is what appear in /var/log/messages:


```
Dec 17 14:03:53 nsdhcp dhcpd: Can't bind to dhcp address: Address already in use
Dec 17 14:03:53 nsdhcp dhcpd: Please make sure there is no other dhcp server
Dec 17 14:03:53 nsdhcp dhcpd: running and that there's no entry for dhcp or
Dec 17 14:03:53 nsdhcp dhcpd: bootp in /etc/inetd.conf.   Also make sure you
Dec 17 14:03:53 nsdhcp dhcpd: are not running HP JetAdmin software, which
Dec 17 14:03:53 nsdhcp dhcpd: includes a bootp server.
Dec 17 14:03:53 nsdhcp root: /etc/rc: WARNING: failed to start dhcpd
Dec 17 14:03:55 nsdhcp dhcpd: Can't bind to dhcp address: Address already in use
Dec 17 14:03:55 nsdhcp dhcpd: Please make sure there is no other dhcp server
Dec 17 14:03:55 nsdhcp dhcpd: running and that there's no entry for dhcp or
Dec 17 14:03:55 nsdhcp dhcpd: bootp in /etc/inetd.conf.   Also make sure you
Dec 17 14:03:55 nsdhcp dhcpd: are not running HP JetAdmin software, which
Dec 17 14:03:55 nsdhcp dhcpd: includes a bootp server.
Dec 17 14:03:55 nsdhcp root: /etc/rc: WARNING: failed to start dhcpd
```


----------

