DevToolsmith

Port 179: BGP

Port 179 (TCP) is used by BGP, the routing protocol that connects networks on the internet. It is a well-known port (0–1023). On Linux and macOS, binding to it needs root or the CAP_NET_BIND_SERVICE capability.

Service
BGP
Protocol
TCP
Range
Well-known (0–1023)
Official
IANA-registered
Exposure
Restrict access
Category
Network services

What uses port 179

Routers at ISPs, cloud providers and large networks exchange routes with their peers over long-lived TCP sessions on port 179. Inside data centers, BGP is also used by Kubernetes network plugins such as Calico and MetalLB to announce pod and service addresses to the network.

Should port 179 be open to the internet?

Restrict access. Only open this port to known networks or users, for example your office IP, a VPN or behind authentication.

  • Only accept BGP sessions from configured peer addresses, and protect sessions with TCP-AO or MD5 passwords and the GTSM TTL check.

Check what is listening on port 179

Linux
sudo ss -ltnp 'sport = :179'
macOS
sudo lsof -nP -iTCP:179 -sTCP:LISTEN
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 179 -State Listen
netstat -ano | findstr :179

No output means nothing is listening. If a service should be, check that it is running and which address it binds to: 127.0.0.1 only accepts local connections, 0.0.0.0 or :: accepts them on every interface.

Fix “address already in use” on port 179

Another process already holds the port. Find it with the commands above, then stop that service properly, or end the process:

macOS / Linux
sudo kill $(sudo lsof -t -iTCP:179 -sTCP:LISTEN)
Windows (PowerShell)
Stop-Process -Id (Get-NetTCPConnection -LocalPort 179 -State Listen).OwningProcess

Allow port 179 from trusted networks only

The examples allow 179 only from 10.0.0.0/8; replace it with your own private network, office IP or VPN range.

Ubuntu / Debian (ufw)
sudo ufw allow from 10.0.0.0/8 to any port 179 proto tcp
# Close it again:
sudo ufw delete allow from 10.0.0.0/8 to any port 179 proto tcp
RHEL / Fedora / Rocky (firewalld)
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="179" protocol="tcp" accept'
sudo firewall-cmd --reload
Windows (PowerShell, as administrator)
New-NetFirewallRule -DisplayName "BGP 179/TCP" -Direction Inbound -Protocol TCP -LocalPort 179 -Action Allow -RemoteAddress 10.0.0.0/8

On AWS, Google Cloud and Azure, also allow the port in the security group or network firewall rules; host firewalls and cloud firewalls are separate.

Test port 179 from another machine

macOS / Linux
nc -zv example.com 179
Windows (PowerShell)
Test-NetConnection example.com -Port 179

Related ports

  • Port 6443 (Kubernetes API server): the default port of the Kubernetes API server.
  • Port 53 (DNS): used by DNS to translate domain names into IP addresses.

More network services ports

67 (DHCP server) , 68 (DHCP client) , 88 (Kerberos) , 123 (NTP) , 135 (Microsoft RPC) , 137 (NetBIOS Name Service) , 389 (LDAP) , 636 (LDAPS) . See all ports in the port lookup.

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What is port 179 used for?

Port 179 is used by BGP, the routing protocol that connects networks on the internet. Routers at ISPs, cloud providers and large networks exchange routes with their peers over long-lived TCP sessions on port 179. Inside data centers, BGP is also used by Kubernetes network plugins such as Calico and MetalLB to announce pod and service addresses to the network.

Is it safe to open port 179?

Only open this port to known networks or users, for example your office IP, a VPN or behind authentication. Allow it only from the networks that need it, as in the firewall examples on this page.

How do I check if port 179 is open?

On the server, list listening sockets with "sudo ss -ltnp 'sport = :179'" on Linux or "sudo lsof -nP -i :179" on macOS. From another machine, run "nc -zv host 179" or, on Windows, "Test-NetConnection host -Port 179". Connection refused means nothing is listening; a timeout means a firewall is dropping the traffic.