You are not logged in.

#1 2013-02-26 04:17:35

kemurphy
Member
Registered: 2013-02-26
Posts: 3

Automatic network configuration on startup

Is there a way to configure the network automatically on startup?  I tried ifconfig_em0="dhcp" in /etc/conf.d/network and that didn't do anything.  (It would be super nice if we could get netcfg....)

Offline

#2 2013-02-26 07:32:39

zygotb
Member
From: Hell's Half Acre
Registered: 2013-02-26
Posts: 2
Website

Re: Automatic network configuration on startup

Doesn't the wiki list dhclient as the networking app?

dhclient <interface>

When I run ifconfig from within a VM I get "ed0" as my connected interface, so to connect I use the following:

dhclient ed0

It works for me!

Offline

#3 2013-02-26 08:35:06

Blµb
Administrator
Registered: 2013-01-24
Posts: 57

Re: Automatic network configuration on startup

I think the network init scripts need to be adapted a bit for this.

Offline

#4 2013-02-26 11:53:08

kemurphy
Member
Registered: 2013-02-26
Posts: 3

Re: Automatic network configuration on startup

@zogotb: Yeah, but I don't want to have to type that every time I bring the machine up. smile
@Blµb: I tried to follow what was happening in /etc/init.d/network and it looked like the ifconfig_em0 line should have worked with a static configuration, but I couldn't find any mention of dhcp.

Offline

#5 2013-02-26 17:37:40

Amzo
Administrator
Registered: 2013-01-21
Posts: 144

Re: Automatic network configuration on startup

A script needs to be added / or modified for automatic dhcp.

Offline

#6 2013-03-15 15:47:45

zygotb
Member
From: Hell's Half Acre
Registered: 2013-02-26
Posts: 2
Website

Re: Automatic network configuration on startup

kemurphy wrote:

@zogotb: Yeah, but I don't want to have to type that every time I bring the machine up. smile
...

Perhaps taking 20 seconds to search the net for answers would be preferable to waiting around for someone to address your issue, or is typing those 12 characters every time you login too much effort?

Here's what I found:

Make an /etc/rc.local file that looks like this:

dhclient ed0

Change the "ed0" part to match whatever your NIC is called.

Last edited by zygotb (2013-03-15 15:49:13)

Offline

#7 2013-03-17 13:24:26

kemurphy
Member
Registered: 2013-02-26
Posts: 3

Re: Automatic network configuration on startup

zygotb wrote:

Perhaps taking 20 seconds to search the net for answers would be preferable to waiting around for someone to address your issue, or is typing those 12 characters every time you login too much effort?

Here's what I found:

Make an /etc/rc.local file that looks like this:

dhclient ed0

Change the "ed0" part to match whatever your NIC is called.

Hey, easy on the tone, it's not like I was expecting someone to address the issue right away; I was just wondering if the ArchBSD network scripts supported DHCP at the moment.  I source-dove, didn't see anything, and asked here.  I ended up doing the rc.local thing after Amzo said support from the network scripts wasn't done yet. 

As an aside, the rc.local solution would be the obvious choice a decade ago, but this is 2013; invoking dhclient in rc.local is a band-aid workaround to a problem that simply shouldn't exist these days (namely, automatic configuration of network interfaces in a dynamic fashion).  Really, putting anything in rc.local is rather annoying to maintain, IMO.  It's nice when things Just Work(tm).

Last edited by kemurphy (2013-03-17 13:25:02)

Offline

Board footer

Powered by FluxBB