开发者

DHCP client bind error on port 68

开发者 https://www.devze.com 2022-12-12 11:53 出处:网络
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

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?


You need to be super user to bind to ports lower than 1024, have you tried running it with sudo?

To find out if something is bound to port 68, do:

sudo netstat -l -u -n -p | grep 68


Question: Are you root? You must be root to bind to a privileged port (less that 1024).


netstat is your guy for finding all your network connections.

you want something like netstat -l, to display listening endpoints.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号