Jump to content

Cygwin eth0 eth1 node name for dhcpd


Recommended Posts

Using cygwin I compiled dhcpd using instructions from here

http://www.angelfire.com/linux/skip/dhcp/

that didn't quite work right.

I got it working

make sure you have the following installed in cygwin

diff

gcc-core

gcc-g++

make

patchutils

modify step 4 because "make install" does not work properly

I had to do as follows

after step 3 I did

cd ./work.cygwin/server

make install

cd ../../

modify step 6 because vi is hard to use and isn't there by default

/cygdrive/c/Program\ Files/Windows\ NT/Accessories/wordpad.exe c:\\cygwin\\etc\\dhcpd.conf

dhcpd -t

modify step 8 because eth1 is not a windows node name. I created a batch script to get the node names

I named this nodename.bat

setlocal EnableDelayedExpansion

set "networkfile=%HOMEDRIVE%%HOMEPATH%\networks.reg"

set "nodefile=%HOMEDRIVE%%HOMEPATH%\nodes.txt"

regedit.exe /e "%networkfile%" HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Network\

type "%networkfile%" | findstr "HKEY_LOCAL ""Name""" > "%nodefile%"

del "%networkfile%"

FOR /F "tokens=1,2 delims==" %%A IN ('type "%nodefile%"') DO (

set "lasttest=!test!"

set "test=%%A"

if "!test!" == ""Name"" (

set "node={!lasttest:*}\{=!"

echo !node:~0,-12!

echo %%B

echo.

))

del "%nodefile%"

pause

pick the node name that goes with ethernet card you know has the address you want to send dhcp out on

C:\nodename.bat

{00483384-F5A0-4A61-8735-DB61F1D34BED}

"Local Area Connection"

{F56A0B21-4092-4D9C-944E-870CDD103222}

"Local Area Connection 2"

Press any key to continue . . .

ipconfig says that "Local Area Connection"

has the ip I want to send dhcp out on so I use

dhcpd -d {00483384-F5A0-4A61-8735-DB61F1D34BED}

and there you go.

I remember for some other thing a while back having to get the network node name and having to open regedit going to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Network\ and searching through each to find what your network card was. I don't remember what for but this script would have made it much easier. It took me a while writing it because I wanted it windows 7 compatible.

Edited by jeff.sadowski
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...