FreeBSD: Interface only settable by DHCP?!? reddit / BSD ---------------------------------------------------------------------- SageRaven · 2010-07-19 19:38 I've got a recent client who signed up with a FreeBSD VPS. Given the VPS is rather small, I was trying to trim the fat in terms of applications running at start-up. I tried to do a static config of the interface, so I don't need to have "dhclient" running. Problem is, I *can't* do a static config. Even with the static config in rc.conf, I noticed that dhclient is still getting launched. So I renamed the dhclient binary, and sure enough the OS cannot initialize the interface statically. So what's the deal? How is it that a machine (VM) can be *forced* to only allow DHCP on the interface? EDIT: Figured it out. They placed stuff into rc.local, which (aside from being rare, in my experience) is different than how they've done it on other VMs. ---------------------------------------------------------------------- m1ss1ontomars2k4 · 2010-07-19 20:31 That's odd...I dunno how the IP configuration on my society's server is set up, exactly but I know it's static and dhclient is definitely not running. ---------------------------------------------------------------------- SageRaven · 2010-07-19 20:37 Apparently, if the interface fails to initialize with a static config, the network boot scripts automatically then try DHCP. There's no mention of DHCP anywhere in my rc.conf file. I don't know if this is a customization of the VPS or FreeBSD's default behavior. Irritating, nonetheless. ---------------------------------------------------------------------- kommissar · 2010-07-19 20:40 Been a while since I've used FreeBSD, but renaming the `dhclient` binary is not the way to stop it from running. Have you tried `dhclient_enable="NO"` inside of `/etc/rc.conf`? Back when I did use FreeBSD, my network was simply configured by setting `hostname`, `defaultrouter` and `ifconfig_interface` in `/etc/rc.conf`. The last one might look like `ifconfig_dc0="inet 192.168.1.3 netmask 255.255.255.0"`. I can't remember if I explicitly disabled `dhclient` or not. ---------------------------------------------------------------------- [deleted] · 2010-07-19 20:40 I'm a Linux guy so I may be off base, but VMs often use DHCP to connect from the VM's "virtual" network device to the physical network device on the host. At least in Linux. The virtual machine doesn't directly communicate to the outside world - it has to be bridged to the physical device. I am not an expert on VMs but every one I've played around with used DHCP to do this. In order to configure in a static way, the bridge connection (the DHCP one we're talking about) has to be connected to a different device or IP on the host. [Virtual Machine] <->DHCP bridge<-> [Host physical network device]. ---------------------------------------------------------------------- SageRaven · 2010-07-19 21:44 DHPC normally needs to be explicitly enabled to be used: ifconfig_foo0="DHCP" I *have* a static config in rc.conf (I'm not totally dense), but it just doesn't take during boot. I used the exact same settings I see with "ifconfig" when the machine comes up with DHCP, yet it doesn't work. It's almost as if the VM's interface isn't authenticated to be brought to an "UP" state unless it's first asked for config info from the DHCP server. I suppose this is no big deal, but it seems a tragic waste of a few MB of memory for something that you don't typically run on a server. ---------------------------------------------------------------------- jhujhiti · 2010-07-19 21:57 The VPS provider has probably changed something in the startup scripts so dhclient is always launched, regardless of the rc.conf setup. ---------------------------------------------------------------------- nirs · 2010-07-19 22:04 /etc/rc.conf contains only what you want to override from /etc/default/rc.conf (I'm not near my bsd machine - the name may be wrong). ---------------------------------------------------------------------- takeda64 · 2010-07-20 02:22 I think you're right. On my setup the only process that contains letters "dhc" is dhcpd that I set up myself. IPs on all the interfaces (it's a multihomed machine) are statically set. ---------------------------------------------------------------------- [deleted] · 2010-07-20 02:24 [deleted] ---------------------------------------------------------------------- Ferrofluid · 2010-07-20 03:20 Anybody know why PCBSD does not run in Virtualbox, or the live bit work for that matter, whats the secret !? ---------------------------------------------------------------------- [deleted] · 2010-07-20 03:40 [deleted] ---------------------------------------------------------------------- SageRaven · 2010-07-20 04:15 Yeah, the sneaky bastards snuck ssh and dhcp stuff in there. First time I've ever seen that; most places use rc.conf instead. ---------------------------------------------------------------------- benz8574 · 2010-07-20 06:49 Virtualbox seems to have problems with the BSDs. I tried MirBSD in it some time ago and had constant and random segfaults of all kinds of programs- ---------------------------------------------------------------------- cjg_ · 2010-07-20 17:31 Guess it is so you don't accidentially lock yourself out of the machine. ---------------------------------------------------------------------- m1ss1ontomars2k4 · 2010-07-20 18:31 That's odd..FreeBSD is fine for me. Maybe it's a PC-BSD only thing. ---------------------------------------------------------------------- SageRaven · 2010-07-20 19:19 Not needed, as they provide remote console access.