dhcp

Is there a method to procedurally detecting if network router supports DHCP using C/C++?

There is a scenario where an application tells a device on a network to get their IP address from the network router's DHCP server. If a DHCP server is not available, the device's behavior becomes erratic. Is there a method to procedurally detect if the network router supports DHCP? Or, is this something the device needs to do when at...

Get mac address from IP using DHCP?

I am trying to create scripts/services that allow for waking PCs in a windows domain via WOL. Now i want to give the user the option to select an AD container as a starting point for the waking of PCs contained within. My initial thought is using DHCP as a repository to query for MAC addresses given the hostnames (which i can easily enou...

DHCP client bind error on port 68.

I am creating a dhcp client in Linux(Ubuntu). I am creating a udp socket and binding it to port 68 and then call recvfrom. I receive a permission denied bind error. I suspect there is a daemon or process which is already bound to port 68. How do I find it? ...

A basic DHCP client

I am coding a very simple DHCP client in C. I have trouble deciding whether it should use UDP or TCP, what basic commands should it support. I think it should be able to get at least DNS, SMTP, POP3 server information from server. What else do I need to know? Is there a basic DHCP C implementation available which can help? ...

DHCP : Cant receive reply from server

I am working on Ubuntu 9.04. I am running this on VMware workstation. Here is my C code: int sockfd,cnt,addrlen; const int on = 1; struct sockaddr_in servaddr,cliaddr; char reply[512]; sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { perror("socket"); exit(1); } setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR, &on,sizeof(on...

Why DHCP client listens on port 68?

If suppose client does not listen on 68 port,when DHCP server receives the request, it can send it to the address from where it received request (with ephemeral port chosen by client at time of sending), then why does protocol specifies client to be listening on port 68? ...

Implementing DHCP client

On unix using C, my client is listening on port 68 with superuser mode. After sending DHCP discover message, when I try to receive, it blocks in recvfrom means there is no message received or is it like system has a process (DHCP client) listening on same port 68 which receives the message and thats my process are not able to receive th...

Does DHCP client receive DHCP NAK if any of the parameters are wrong in DHCP Release?

I am building a dhcp client using C on Ubuntu 9.04. Now I send a dhcp release to the dhcp server, it sends no ack as expected. I was wondering if it sends any DHCP NAK if any of the parameters are wrong. There is one more problem. After sending DHCP Release my internet is still working. Also when I do ifconfig it still shows the ip addr...

In Powershell, what's the best way to join two tables into one?

I'm fairly new to Powershell, and am wondering if someone knows of any better way to accomplish the following example problem. I have an array of mappings from IP address to host-name. This represents a list of active DHCP leases: PS H:\> $leases IP Name -- ---- 192.168.1.1 Apple 192.16...

Querying a DHCP server in C#

I need to get the mapping of MAC to IP stored on DHCP server, either through a program running on the server itself or preferably through a program running on one of the DHCP clients. I understand netsh utility can be used to get the dump however i have not had much success with that. Any working examples or hint on that? I have admin...

How to configure access points and dhcp ranges?

I have a Thomson ST585V6 router and 2 TRENDnet TEW-636APB Wireless Access Points. And I have 3 devices that need a static IP address. All the other devices need to have their IP adreess assigned with DHCP. Here is what I did: In each of the 3 devices that need static IP I assigned the static IPs 192.168.1.64, 192.168.1.65 and 192.168.1....

Ubuntu 9.10 and Squid 2.7 Transparent Proxy TCP_DENIED

Hi, We've spent the last two days trying to get squid 2.7 to work with ubuntu 9.10. The computer running ubuntu has two network interfaces: eth0 and eth1 with dhcp running on eth1. Both interfaces have static ip's, eth0 is connected to the Internet and eth1 is connected to our LAN. We have followed literally dozens of different tutori...

ARP Communication

Does DHCP use ARP only as communication protocol to assign an IP Address? ...

C# Poll multiple devices to determine IP type: Static or DHCP

Would like to know the c# code to actually retrieve the IP type: Static or DHCP based on a list of devices I will enter. Output to be viewed: Device name: IP Address: MAC Address: Type: Marvell Yukon 88E8001/8003/8010 PCI Gigabit Ethernet Controller NULL 00:00:F3:44:C6:00 DHCP Generic Marvell Yukon 88E8056 based Ethe...

DNS resolve without depending on router for asterisk system

Hello, Basically I have a Debian box running asterisk assigned an IP via DHCP with host-name XXX. My windows browser can resolve the host-name but if I use host-name in X-Lite or my SPA922 phone it fails to resolve. Is there any way of getting this to work without depending on the router or assigning a static IP (request is to make it po...

Detecting a change of IP address in Linux

Does anyone know a way to detect a change of IP address in Linux. Say I have dhcpcd running, and it assigns a new IP address, is there a way I can get a notification when it changes? I can't use D-Bus, because this is an embedded ucLinux build that doesn't have it. inotify on something in /proc/net/ ? ...

Retrieving Windows DHCP servers list and scope information of each DHCP server using .NET

We are doing a small dashboard to retrieve and display the DHCP servers list in a LAN and then getting the Scope information like IPs used and unused and the count using .NET preferably C#. How could that be made possible. ...

Discovering the default gateway without DHCP

A crazy question, but is there anyway to discover the default gateway without DHCP? This would be for a device on a network which does not use DHCP which does not have an IP address as yet. I was thinking if I could discover the default gateway, then i could try to guess an unused ip address then broadcast on the network to see if it's ...

git: basic question, how to punch through firewalls, NAT boxes, etc

Sorry, if this is a FAQ, but I can't find the answer. I'm intrigued by git. I've used nearly all of the usual players over the past decades. Currently on SVN and not really happy. I think I understand the basics, but I don't understand one key concept: how does a user in his/her house talk to/from my computer (separate houses, ISP, etc....

C# DHCP Access Error

I'm using dhcpobj.dll to interface with our DHCP servers and when I try to reference any Scope property other than "Address", I get a Windows dialog box stating there was a COM Surrogate error, followed by a COMException in my code stating that "The remote procedure call failed. (Exception from HRESULT: 0x800706BE). Has anyone come acro...