MSFN Forum: Cygwin eth0 eth1 node name for dhcpd - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cygwin eth0 eth1 node name for dhcpd A better way to get the node name for cygwin Rate Topic: -----

#1 User is offline   jeff.sadowski 

  • Junior
  • Pip
  • Group: Members
  • Posts: 69
  • Joined: 01-March 07

Posted 16 March 2010 - 10:41 AM

Using cygwin I compiled dhcpd using instructions from here
http://www.angelfire...inux/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

Quote

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.

This post has been edited by jeff.sadowski: 16 March 2010 - 10:43 AM



#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 7,349
  • Joined: 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 16 March 2010 - 12:52 PM

You may have missed those words at the top of the forum with the big red letters.

Moving to Networking forum.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy