# help moving to non-deprecated /etc/conf.d/net [SOLVED]

## unixj

After updating my baselayout I'm getting the warnings about:

```
 *   You are using a deprecated configuration syntax for eth0

 *   You are advised to read /etc/conf.d/net.example and upgrade it accordingly

```

I have read net.example, several times, back and forth, but I still must be doing something wrong. When I restart my network (/etc/init.d/net.eth0 start) dhcp just hangs when starting up.

My old /etc/conf.d/net:

```
iface_eth0="192.168.1.47 broadcast 192.168.1.255 netmask 255.255.255.0"

gateway="eth0/192.168.1.1"
```

Pretty simple eh?  And for the new one I've tried all permutations (adding and removing) the following, as well as a lot of other stuff:

```
config_eth0=( "192.168.1.47 netmask 255.255.255.0 broadcast 192.168.1.255" )

routes_eth0=( "default via 192.168.1.1" )

modules=( "dhcpcd" )

config_eth0=( "dhcp" )

dhcp_eth0="release nodns nontp nonis"

```

I would like to use iproute2 if possible (since I assume ifconfig will also be deprecated at some point).  I do have it installed.[topic=][/topic]Last edited by unixj on Sun Sep 03, 2006 7:15 pm; edited 1 time in total

----------

## hanj

Can you watch the logs on the DHCP server? Can you see the request coming in? Also.. I might be wrong, but my routes_eth0 uses gw (gateway) not via

```
routes_eth0=( "default gw 192.168.1.1" ) 
```

I thought that there was a dhcp issue with the new baselayout requiring a dhcp update. I would first try to set an IP statically first.. to determine that the interface is getting up and your network is reachable. Then from there, start debugging DHCP.

HTH

hanji

----------

## I.C.Wiener

Hmm, the new config looks fine, but you should decide whether you want to use dhcp or a static ip:

static:

```

config_eth0=( "192.168.1.47 netmask 255.255.255.0 broadcast 192.168.1.255" )

routes_eth0=( "default via 192.168.1.1" ) 

```

dhcp (needless to mention that you need to emerge dhcpcd for this to work):

```

modules=( "dhcpcd" )

config_eth0=( "dhcp" )

```

Edit: Of course unlike Windows (which simply chooses a random IP on it's own if no dhcp-server is available) Linux requires a dhcp-server or it won't assign an ip to your network card.

----------

## unixj

Thanks to both of you (talk about quick replies- 3 mins!!!)  Your posts made me realize I am using dhcp but the server is running on the router/modem.  Argh.  I commented out everything for dhcp and it seems to have worked- I'll know for sure at next reboot.

Thanks!

----------

## yther

Thanks also for giving me the clue that gateway had to be set using route_eth0; prior to re-installing this box I was using DHCP just fine.  Now, trying that results in the NIC being so noisy it floods itself off the network.  (Not technical terms, but that's what it looks like to me, judging from the frenzied lights on the router and the fact that a ping sometimes goes out but then the next ping says "Network is unreachable.")

[shrug]

Since I have the router configured to always assign the same IP anyway, I'm going with static now.  Previously DHCP was easier (just start it and you're done), but now I can't figure it out.  (Isn't it supposed to be simple?)  DHCP on the LiveCD kept trying to use IPV6 as well.   :Razz: 

It works now.  I'm happy.

----------

## drawsmcgraw

Okay, I'm missing something... I can get my NIC up and I can get to my router (via IP address in the browser), but I can't get anywhere... I'm guessing it has something to do with the default route...

```

Lugh conf.d # /etc/init.d/net.eth0 restart

 * Caching service dependencies ...                                                                                                                                                 [ ok ]

 * Unmounting network filesystems ...                                                                                                                                           [ ok ]

 * Stopping sshd ...                                                                                                                                                            [ ok ]

 * Stopping eth0

 *   Bringing down eth0

 *     Stopping dhcpcd on eth0 ...                                                                                                                                              [ ok ]

 *     Shutting down eth0 ...                                                                                                                                                   [ ok ]

 * Starting eth0

 *   Bringing up eth0

 *     192.168.1.112/24                                                                                                                                                         [ ok ]

 *   Adding routes

 *     default gw 192.168.1.1 ...                                                                                                                                               [ ok ]

 * Mounting network filesystems ...                                                                                                                                             [ ok ]

 * Starting apache2 ...                                                                                                                                                         [ ok ]

 * Starting sshd ...                                                                                                                                                            [ ok ]

Lugh conf.d # !ping

ping www.yahoo.com

ping: unknown host www.yahoo.com

```

Here's a few of my lines...

```

config_eth0=( "192.168.1.112/24 broadcast 192.168.1.255" )

routes_eth0=( "default gw 192.168.1.1" )

```

Also, I have that chunk of gateway lines commented out

```

#gateways_eth0="192.168.0.1 10.0.0.1"

#gateways_eth0="192.168.1.1 "

#config_192168000001=( "192.168.0.2/24" )

#routes_192168001001=( "default via 192.168.1.1" )

#dns_servers_192168001001=( "192.168.1.1" )

#config_010000000001=( "10.0.0.254/8" )

#routes_010000000001=( "default via 10.0.0.1" )

#dns_servers_010000000001=( "10.0.0.1" )

```

Tried uncommenting them and tailoring them to my network... nothing.

**EDIT

I'm assuming the filename should be /etc/conf.d/net.eth0 here... am I wrong or would that be a problem...?

----------

## Chewi

drawsmcgraw, if you're not using DHCP then you probably need to assign a DNS server in your configuration. If you want the same IP every time (I read your LJ post) then you're probably better off adding your MAC address to your router. Almost all routers support that.

----------

## drawsmcgraw

 *Quote:*   

> drawsmcgraw, if you're not using DHCP then you probably need to assign a DNS server in your configuration.

 

You mean like this?

```

dns_servers_192168001001=( "192.168.1.1" )

```

I've tried that to no avail..... 

And about adding my MAC to the router... Do you mean telling my router to always give my machine (identified by my MAC) the same IP and just using DHCP?

----------

## Chewi

I'm not sure how the new configuration works so perhaps you're not doing something right but regardless of that, if you're not using DHCP, you do need to set a DNS server.

I do mean that, yeah. I do that because it means I don't have to reconfigure my network settings when I take my laptop elsewhere.

----------

## drawsmcgraw

I'll try the DHCP method, then. I'm using the DD-WRT firmware for my router. You don't happen to know how to go about doing it with that, do you?

Thanks!

----------

## uagent

If you want to use DHCP w/ that firmware, you can set a static IP for your MAC with the instructions at:

http://www.dd-wrt.com/wiki/index.php/Static_DHCP

----------

