how to use socket to get packet which destination ip is not local?

Mark Wooding mdw at
Wed Nov 17 17:08:04 CET 2010

Hans <hansyin at> writes:

> I tried socket bind to, but it only binds to any local ip, not
> any ip which may not be local. therefore the socket cannot get that
> dhcp offer packet even I can use wireshark to see that packet did come
> to this pc.

You must use a raw socket for this.  Raw sockets are fiddly, not very
portable, and require privilege.  Sorry.

-- [mdw]

More information about the Python-list mailing list