Advertisement

02.16.2005 at 08:19PM PST, ID: 21318004
[x]
Attachment Details

Sending RAW DHCP Packets in Linux

Asked by GAZZA in Linux Programming

Tags: linux, raw, socket, dhcp

Setup:
Serial connection to Linux OS.
Reading IP packets being sent across serial connection

I am trying to take a DHCP IP packet sent from the serial connection and send it to regular ethernet DHCP Server.

I create a RAW socket connection as follows:

socket(PF_PACKET, SOCK_RAW, ETH_P_ALL);

I am able to get the packet from the serial connection, I then add on the ETH HDR to the front of this packet and then sendto the socket. Using a sniffer on another PC I can see that the packet is sent to the network, but no DHCP server reply's to this DHCP request...

Is there something extra I need to do so that this DHCP packet is responded to?

My ETH HDR PAcket added to the front of the DHCP IP header is:

SRC ADDR: xx:xx:xx:xx:xx:xx   // note: not the MAC addr of the Linux PC
DEST Addr: ff:ff:ff:ff:ff:ff
Proto:         0x0800

Start Free Trial
[+][-]02.17.2005 at 02:46AM PST, ID: 13333269

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.17.2005 at 07:20AM PST, ID: 13335365

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2005 at 08:43AM PST, ID: 13336406

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.17.2005 at 05:51PM PST, ID: 13341907

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.24.2005 at 04:29PM PST, ID: 13398840

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.30.2005 at 09:59AM PST, ID: 13664239

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.08.2005 at 10:47PM PDT, ID: 13742584

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.13.2005 at 07:55AM PDT, ID: 13772972

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux Programming
Tags: linux, raw, socket, dhcp
Sign Up Now!
Solution Provided By: DarthMod
Participating Experts: 4
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32