You are not logged in.

#1 2009-08-07 15:33:47

hbarnwheeler
Member
Registered: 2006-08-11
Posts: 37

[SOLVED] No network when setting static IP on boot

When I have:

eth0="eth0 192.168.1.73 netmask 255.255.255.0 broadcast 192.168.1.255"

set in rc.conf at boot, I get no network.  I can't even ping machines on the LAN.  When I have

eth0="dhcp"

in rc.conf at boot, the network works fine.  What I can't figure out is why, if I boot with the dhcp line in rc.conf, then change that line to read

eth0="eth0 192.168.1.73 netmask 255.255.255.0 broadcast 192.168.1.255"

and execute

/etc/rc.d/network restart

the network works fine and I get what I want: a static IP.  How can I set it so I get my desired IP on boot?

Last edited by hbarnwheeler (2009-08-07 22:54:52)

Offline

#2 2009-08-07 22:34:04

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] No network when setting static IP on boot

What is the exact problem you've having?

At a guess, I'd say the DHCP client sets you Default Route and DNS Servers in /etc/resolv.conf which you may not be doing when you change to static IP. It works it you boot with DHCP, then change to Static because the DHCP client has already set them, but if you boot directly to a Static IP address, they don't get set.

Offline

#3 2009-08-07 22:56:14

hbarnwheeler
Member
Registered: 2006-08-11
Posts: 37

Re: [SOLVED] No network when setting static IP on boot

fukawi2 wrote:

What is the exact problem you've having?

At a guess, I'd say the DHCP client sets you Default Route and DNS Servers in /etc/resolv.conf which you may not be doing when you change to static IP. It works it you boot with DHCP, then change to Static because the DHCP client has already set them, but if you boot directly to a Static IP address, they don't get set.

I figured something like this must be happening.  I.e.  DHCP server does more than bring up the interface with IP, broadcast IP and subnet mask.  I solved the problem by changing

ROUTES=(!gateway)

to

ROUTES=(gateway)

Offline

Board footer

Powered by FluxBB