Short questions on DHCP

D.Moriarty declan.moriarty at ntlworld.ie
Fri Oct 22 09:31:01 PDT 2004


(Snip waffling about ancient script versions)

Nathan Coulson wrote:

> if I recall, the older bootscripts had something like
> if /etc/sysconfig/network-devices/ifup-eth0 existed, then run ifup-eth0.
> [there was also a ifdown-eth0]  replacing eth0 with whatever you like
> 
> you could just stick those lines you got in there, and it should just
> work.  [assuming ifconfig.eth0 exists.  It is sourced by the ifup-eth0
> and ifdown-eth0 files, if you want to store varaibes in there, but
> even if empty, ifconfig.eth0 will have to exist].
> 
> the BLFS 1.0 [not sure when we moved to the newer bootscripts] may
> even have some better examples.
> 
/Start Bootscript trivia
What I had was
/etc/rc.d/init.d/localnet - for the 'lo' i/face
/etc/rc.d/init.d/network - for a non dhcp typical network interface. 
This all worked up to one line much like this:

ifconfig $IF netmask $NETMASK gw GATEWAY $IP

And barfed if it hadn't all the relevant values
then there was
/etc/sysconfig/network - genetral information
/etc/sysconfig/network-devices/ifup
/etc/sysconfig/network-devices/ifdown
/etc/sysconfig/network-devices/ifconfig.<each interface>

If I junk /etc/rc.d/init.d/network, and replace it with something 
calling my severely hacked /etc/sysconfig/network-devices/ifup, I can 
get going more or less. It's barfing over something stupid and not 
running dhcpcd, but I can do that. It seems like a whole lot of farting 
about to run three or four commands anyhow - scripts to look up scripts 
and run other scripts. Why can't init become a single file with along 
these lines
<path>/<command>  <options> #Comment if necessary for an error message
which are run in groups instead os one a f t e r another, and doesn't 
die on errors, the better.
/End bootscript trivia


Gentlemen, The problem is mine: I am sending packets I think(checked 
with tcpdump)  receiving packets, dropping them all and listening to none.

eth0      Link encap:Ethernet  HWaddr 00:50:70:22:C5:73
           UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:166 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:100
           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
           Interrupt:16 Base address:0x2000

There's no routes open (route -n produces no digits at all). Dhclient or 
dhcpcd just holler out into the great CAT5, but nothing hears them. I've 
set up routes, populated resolv.conf fairly imaginatively, and only 
pissed myself off while my windoze nerds are snickering quietly. Here's 
tcpdump's o/p during a dhcpcd -d eth0 exercise

root:~#tcpdump -eevn -i eth0

tcpdump: WARNING: eth0: no IPv4 address assigned
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 68 
bytes
16:53:01.101439 00:50:70:22:c5:73 > ff:ff:ff:ff:ff:ff, ethertype IPv4 
(0x0800), length 590: IP (tos
0x0, ttl  64, id 61684, offset 0, flags [none], length: 576) 0.0.0.0.68 
 > 255.255.255.255.67: BOOTP/DHCP, Request [|bootp]
16:53:05.226408 00:50:70:22:c5:73 > ff:ff:ff:ff:ff:ff, ethertype IPv4 
(0x0800), length 590: IP (tos
0x0, ttl  64, id 61685, offset 0, flags [none], length: 576) 0.0.0.0.68 
 > 255.255.255.255.67: BOOTP/DHCP, Request [|bootp]
16:53:13.306406 00:50:70:22:c5:73 > ff:ff:ff:ff:ff:ff, ethertype IPv4 
(0x0800), length 590: IP (tos
0x0, ttl  64, id 61686, offset 0, flags [none], length: 576) 0.0.0.0.68 
 > 255.255.255.255.67: BOOTP/DHCP, Request [|bootp]
16:53:29.376406 00:50:70:22:c5:73 > ff:ff:ff:ff:ff:ff, ethertype IPv4 
(0x0800), length 590: IP (tos
0x0, ttl  64, id 61687, offset 0, flags [none], length: 576) 0.0.0.0.68 
 > 255.255.255.255.67: BOOTP/DHCP, Request [|bootp]
tcpdump: pcap_loop: recvfrom: Network is down
4 packets captured
4 packets received by filter
0 packets dropped by kernel

That string 00:50:70:22:c5:73 is my nic address. Where are the packets 
going?
-- 

         With Best Regards,

         Declan Moriarty



More information about the blfs-support mailing list