AW: dhcp-relay over tun interface - solution?
Stefan Bauer
stefan.bauer at cubewerk.de
Wed Jan 15 17:02:08 UTC 2014
-----Ursprüngliche Nachricht-----
Von: Shane Kerr <shane at isc.org>
> 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. :-/
Hi Shane,
here are the logs I've generated:
root at test:/usr/sbin# strace -o /tmp/output -e trace=sendto,socket,bind /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 00:10:18:a8:9f:cf to 1.2.3.4
Forwarded BOOTREQUEST for 00:10:18:a8:9f:cb to 1.2.3.4
Forwarded BOOTREQUEST for 00:10:18:a8:9f:cd to 1.2.3.4
Forwarded BOOTREQUEST for 00:10:18:a8:9f:c9 to 1.2.3.4
^C
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 4
bind(20, {sa_family=AF_INET, sin_port=htons(31154), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP) = 4
bind(21, {sa_family=AF_INET6, sin6_port=htons(30687), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: In"..., 83, MSG_NOSIGNAL, NULL, 0) = 83
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: Co"..., 78, MSG_NOSIGNAL, NULL, 0) = 78
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: Al"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: Fo"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 4
bind(4, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: Li"..., 54, MSG_NOSIGNAL, NULL, 0) = 54
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: Se"..., 54, MSG_NOSIGNAL, NULL, 0) = 54
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
bind(5, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 6
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: Li"..., 56, MSG_NOSIGNAL, NULL, 0) = 56
sendto(3, "<30>Jan 15 17:49:02 dhcrelay: Se"..., 56, MSG_NOSIGNAL, NULL, 0) = 56
sendto(4, "\1\1\6\1]\370\223*\f\0\200\0\0\0\0\0\0\0\0\0\0\0\0\0S6\317\376\0\20\30\250"..., 260, 0, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("1.2.3.4")}, 16) = 260
sendto(4, "\1\1\6\1\374\243\312\"\34\0\200\0\0\0\0\0\0\0\0\0\0\0\0\0S6\317\376\0\20\30\250"..., 260, 0, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("1.2.3.4")}, 16) = 260
sendto(4, "\1\1\6\1\374\243\312\"\34\0\200\0\0\0\0\0\0\0\0\0\0\0\0\0S6\317\376\0\20\30\250"..., 260, 0, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("1.2.3.4")}, 16) = 260
sendto(4, "\1\1\6\1\374\243\312\"\34\0\200\0\0\0\0\0\0\0\0\0\0\0\0\0S6\317\376\0\20\30\250"..., 260, 0, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("1.2.3.4")}, 16) = 260
--- SIGINT (Interrupt) @ 0 (0)
More information about the dhcp-hackers
mailing list