Posts: 3
Joined: Thu Mar 09, 2017 4:58 pm

Udp server port 161 Unreachable

Wed Mar 15, 2017 8:45 am


I'm newbies on Raspberry and Linux . When i send the datagram to my Raspberry P3 , Error WhireShare : Destination and Port Unreachable :o :o :o :o :o

I'm try 161 and 8089 .. KO :( :(

Thank for your reply !!!

Excuse for my bad English .... :lol:

Posts: 351
Joined: Thu Mar 28, 2013 9:19 am
Location: Nottingham, UK

Re: Udp server port 161 Unreachable

Wed Mar 15, 2017 9:27 am

That's the SNMP port. By default, as far as I recall, in the 'as default' Raspbian, there is nothing listening on that port, so it comes as no surprise that it cannot be reached.

What are you trying to send, and what do you expect to be listening on the Pi?
Steve S
No, I can't think of anything funny that won't offend someone if they want it to...

Posts: 3
Joined: Thu Mar 09, 2017 4:58 pm

Re: Udp server port 161 Unreachable

Wed Mar 15, 2017 4:51 pm

yes ... i develop a application with a personal SNMP Agent . I would like receve and send the datagram on this port . Pi receive DATA and send DATA .

User avatar
Posts: 39
Joined: Sat Feb 18, 2017 3:44 pm
Location: Phoenix, AZ

Re: Udp server port 161 Unreachable

Sat Mar 18, 2017 12:16 am

I forget if it is installed out-of-the-box, but I'd use the firewalld daemon, which gives the firewall-cmd command. Before you do this, understand the mechanism that it uses, called zones.

Basically, your interfaces will be placed into a public zone, which allows data to exit but not enter (unless it is in response to something that originated from your system). This can cause existing apps to stop communicating, if they're servers or listening.

This can all be managed with the firewall-cmd command. This is fairly well explained here: and here (I know this is a link to Red Hat, but it explains firewalld well, and is virtually identical to the Pi using Raspbian): ... walls.html

To install it, activate it and ensure that it starts when the system starts:

Code: Select all

apt-get install -y firewalld
systemctl start firewalld
systemctl enable firewalld
Now you can open ports, like this, using the public zone and making them persistent:

Code: Select all

firewall-cmd --add-port=161/udp --zone=public --permanent
Reload the firewall:

Code: Select all

firewall-cmd --reload
Verify the port and protocol (an example of mine, using your port number):

Code: Select all

firewall-cmd --list-all
public (default, active)
  interfaces: eth0
  services: dhcpv6-client nfs rpc-bind samba ssh
  ports: 161/udp
  masquerade: no
  rich rules:
Now UDP port 161 will be allowed in.
Red Hat Academy Professor - Estrella Mountain Community College
5 Pi 3 Model B+s: 1 headless media/NFS/SMB server - Raspbian Jessie, 1 Kali Linux w/fruitywifi, 1 headless CentOS 7 webserver (Apache, SELinux, firewalld, autofs, etc...), 2 in waiting

Return to “General discussion”