mknod - Linux

This is a discussion on mknod - Linux ; Can anyone tell me the major and minor numbers to use to mknod a eth0 dev? I don't seem to have an eth0 in the /dev directory so I guess I need to create one. Bill...

+ Reply to Thread
Results 1 to 6 of 6

Thread: mknod

  1. mknod

    Can anyone tell me the major and minor numbers to use to mknod a eth0
    dev? I don't seem to have an eth0 in the /dev directory so I guess I need to
    create one.

    Bill



  2. Re: mknod

    Bill Cunningham wrote:
    > Can anyone tell me the major and minor numbers to use to mknod a eth0
    > dev? I don't seem to have an eth0 in the /dev directory so I guess I need to
    > create one.


    Network devices do not have major numbers. They are neither character
    nor block devices. They don't have entries under /dev either. To talk
    to a network device---for instance, to execute ioctl() calls---you go
    through a socket descriptor: a SOCK_RAW type socket in the PF_PACKET
    family.


  3. Re: mknod

    "Bill Cunningham" writes:

    > Can anyone tell me the major and minor numbers to use to mknod a eth0
    > dev? I don't seem to have an eth0 in the /dev directory so I guess I need to
    > create one.


    No, for reasons that I'm sure made sense to the Berkeley 4.2
    develpers, network devices don't live in the normal device namespace.
    What's not working, so it looks to you like you need a /dev/eth0?
    --
    Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
    Department of Computer Science FAX -- (505) 646-1002
    New Mexico State University http://www.cs.nmsu.edu/~pfeiffer

  4. Re: mknod

    Joe Pfeiffer wrote:
    > What's not working, so it looks to you like you need a /dev/eth0?


    The "ls /dev/eth*" command is failing with a 1 termination status.


  5. Re: mknod

    > What's not working, so it looks to you like you need a /dev/eth0?

    I installed a new dhcpcd and put a script in etc/rc.d called rc.inet1. I
    also try this command at the command prompt and it doesn't seem to want to
    work

    route add -net 127.0.0.0 netmask 255.0.0.0 dev eth0

    Now that's what I've read to do. I have a ethernet driver module installed
    and linked to the kernel so that should work.
    ifconfig..
    I get the loopback device lo
    ifconfig eth0
    I get eth0 with no inet address or subnetmask. I usually use the broadcast
    command to my network's dhcp server to be assigned an ip. dhcpcd -B. I had
    all this working once before now I don't know if I'm putting something in
    the wrong place or don't have a shell script right or what.

    Bill



  6. Re: mknod

    "Bill Cunningham" wrote:
    >> What's not working, so it looks to you like you need a /dev/eth0?

    >
    > I installed a new dhcpcd and put a script in etc/rc.d called rc.inet1. I
    >also try this command at the command prompt and it doesn't seem to want to
    >work
    >
    >route add -net 127.0.0.0 netmask 255.0.0.0 dev eth0


    The address range 127.x.x.x is almost certainly assigned to the lo
    device, and routed to it. You can indeed do something like that
    command, but the results might well be very confusing.

    >Now that's what I've read to do. I have a ethernet driver module installed
    >and linked to the kernel so that should work.
    > ifconfig..
    >I get the loopback device lo
    >ifconfig eth0
    >I get eth0 with no inet address or subnetmask. I usually use the broadcast
    >command to my network's dhcp server to be assigned an ip. dhcpcd -B. I had
    >all this working once before now I don't know if I'm putting something in
    >the wrong place or don't have a shell script right or what.


    Assuming... that you have a functional ethernet card installed,
    you could test it using a statically assigned IP address, and
    when you know it works, then attempt to use DHCP.

    But it might be just as easy to simply read the man page for
    dhcpcd, and do the obvious: Use the -d option after you make
    sure that log output will be recorded by syslog (as described in
    the man page).

    --
    Floyd L. Davidson
    Ukpeagvik (Barrow, Alaska) floyd@apaflo.com

+ Reply to Thread