dhcp-relay over tun interface - solution?
Shane Kerr
shane at isc.org
Wed Jan 15 16:37:23 UTC 2014
Stefan,
On 2014-01-14 16:37:23 (+0100)
Stefan Bauer <stefan.bauer at cubewerk.de> wrote:
> -----Ursprüngliche Nachricht-----
> Von: Shane Kerr <shane at isc.org>
> > Okay, one last attempt. :-P
> >
> > If we add:
> >
> > case ARPHDR_NONE:
> > memset(hw, 0, sizeof(struct hardware));
> > break;
> >
> > Right before the "default:" statement in the get_hw_addr() hack
> > that I posted earlier it might work. This means that if for some
> > reason there is no address we'll just proceed without it.
>
> Hi Shane,
>
> i can now build the binary and bind it:
>
> root at test:~# /usr/sbin/dhcrelay -d -i tuntest -i eth0 1.2.3.4
> Internet Systems Consortium DHCP Relay Agent 4.2.5-P1
> Copyright 2004-2013 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
> Listening on Socket/eth0
> Sending on Socket/eth0
> Listening on Socket/tuntest
> Sending on Socket/tuntest
> Forwarded BOOTREQUEST for d0:27:88:0c:24:17 to 1.2.3.4
> Forwarded BOOTREQUEST for d0:27:88:0c:24:17 to 1.2.3.4
> Forwarded BOOTREQUEST for d0:27:88:0c:24:17 to 1.2.3.4
>
> Unfortunately even though the output is Forwarded BOOTREQUEST for....
> i dont see any traffic on the tuntest interface:
>
> root at test:~# tcpdump -ni tuntest port 67 or 68
> tcpdump: verbose output suppressed, use -v or -vv for full protocol
> decode listening on tuntest, link-type RAW (Raw IP), capture size
> 65535 bytes
>
> So it's either not really forwarding it or it reaches not the network
> layers?!
If you're getting the "Forwarded" message then the Unix system call
sendto() has returned success.
You can check the actual calls being invoked with strace:
# strace -o /tmp/some-file -e trace=sendto,socket,bind \
/usr/sbin/dhcrelay -d -i tuntest -i eth0 1.2.3.4
We use "-o" to tell strace where to put it's output, and "-e" to tell
strace to only trace the sendto(), socket(), and bind() system calls. If
you see calls to send packets to the right place, then it's something
else in the system, which I can't really guess. :-/
Cheers,
--
Shane
More information about the dhcp-hackers
mailing list