# Odd network.....

## Greven

I can get my network to work but I have to type dhcpcd eth0 to get it to start.... And I don't want to do that at boot up every time.

----------

## rac

Have you added net.eth0 to your default runlevel? 

```
# rc-update add net.eth0 default
```

----------

## Greven

That may help..... but now I can't stop KDE from auto starting....

----------

## Naan Yaar

Do:

```

rc-update del xdm default

```

to prevent display managers from starting at the default runlevel.

----------

## freshy98

 *rac wrote:*   

> Have you added net.eth0 to your default runlevel? 
> 
> ```
> # rc-update add net.eth0 default
> ```
> ...

 

will 

```
# rc-update add net.eth0 default
```

 do the same as 

```
#dhcpcd eth0 -h blabla
```

?

I'm a bit confused as in what the rc-update exactly does you see?

one other question: if I specify my host name in etc/host, will dhcpcd eth0 automaticelly check etc/host?

----------

## Naan Yaar

rc-update "just" adds the script in the init.d directory to the runlevel you specify (it actually puts in a symlink).  This means that the script will be started at the runlevel when you reboot (or change your soft runlevel or initlevel...)

When net.eth0 runs, upon the next reboot, e.g., it does something dependent on what you have /etc/conf.d/net.  If you comment out the #iface_eth0="dhcp" line in it, it will set up eth0 based on dhcp.

Not sure what you mean by your /etc/hosts question.  dhcpcd gets your ip address, hostname, domain, dns servers, etc.

 *freshy98 wrote:*   

> ...
> 
> will 
> 
> ```
> ...

 

----------

## Sequentious

What I did, since my ISP requires both a specific hostname *AND* binds it to a specific MAC address, was the following:

in /etc/conf.d/net, there are options for your NICs. if you didnt set this up already, do the following:

- comment out the following line that is near the top of the file (where ... is actually alot more stuff)

```
iface_eth0 ...
```

-uncomment the following lines (where "..." is actually "..."

```
iface_eth0="dhcp"

dhcpcd_eth0="..."
```

-Change the afore mentioned dhcpcd_eth0="..." line so that instead of "..." you have "-h HOSTNAME" (obviously HOSTNAME should be replaced by your hostname)

Then do

```
rc-update add net.eth0 default
```

.

That is the "proper gentoo way". Another method you might feel more comfortable doing would be to open up

/etc/conf.d/local.start

and put your dhcpcd command (and anything else you want to run at boot) in there. The catch is that it will not release your dhcp lease when you shut down (unless of course you add that command to local.stop)

good luck

----------

## freshy98

using "rc-update add net.eth0 default" reports that net.eth0 is already used so I can't do that one again.

Naan Yaar, what Sequentious says is what I think I need to.

DHCPCD doesn't use -h blabla by standard, therefor I thought using /etc/host was needed. using /etc.host as a variable. get what I mean?

greetz!

----------

## Naan Yaar

Thanks for the clarification.  I wasn't sure whether you were referring to the -h option for dhcpcd or the -H option or something else re: /etc/hostname itself  :Wink: 

 *freshy98 wrote:*   

> ...
> 
> Naan Yaar, what Sequentious says is what I think I need to.
> 
> DHCPCD doesn't use -h blabla by standard, therefor I thought using /etc/host was needed. using /etc.host as a variable. get what I mean?
> ...

 

----------

## freshy98

 :Very Happy:  you're welcome! hehe

freshy98

----------

