[Linux]ubuntu開放server的指定埠
refs:
http://askubuntu.com/questions/293356/how-to-open-a-particular-port-in-ubuntu
Run this on the commandline; it should solve issue: sudo iptables -A INPUT -m conntrack –ctstate NEW,RELATED,ESTABLISHED -j ACCEPT
To do a specific port:
sudo iptables -A INPUT -p <tcp OR udp> <--dport OR --sport> <port> -j ACCEPT
INPUT is the chain for incoming traffic. -p is protocol (either tcp or udp –dport or –sportspecify allowing for destination or source port. -j is “jump” and its where you ACCEPT, REJECT, orDROP the packet(s)
所以,開放5600埠接收廣播,結果:
sudo iptables -A INPUT -p udp -d 0/0 -s 0/0 --dport 5600 -j ACCEPT
開放8000埠接收tcp,結果:
sudo iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 8000 -j ACCEPT
設定防火牆的規則,允許5600埠進入
sudo ufw allow 5600
sudo ufw allow 8000
檢視狀態:
sudo netstat -ntlup
nc 用法:
refs:
http://manpages.ubuntu.com/manpages/hardy/man1/nc_openbsd.1.html
CLIENT/SERVER MODEL
It is quite simple to build a very basic client/server model using nc.
On one console, start nc listening on a specific port for a connection.
For example:
$ nc -l 1234
nc is now listening on port 1234 for a connection. On a second console
(or a second machine), connect to the machine and port being listened on:
$ nc 127.0.0.1 1234
相關文章
- Ubuntu 18.04開放指定埠Ubuntu
- linux開放指定埠Linux
- linux開放指定埠命令Linux
- Linux系統下如何在防火牆開放指定埠Linux防火牆
- linux 開放埠Linux
- CentOS開啟防火牆及開放指定埠CentOS防火牆
- linux開放80 埠Linux
- linux 開放埠命令Linux
- Ubuntu檢視埠和釋放埠Ubuntu
- CentOS/Linux 開放80、8080埠或者開放某個埠CentOSLinux
- Ubuntu系統中防火牆的使用和開放埠Ubuntu防火牆
- Windows server 防火牆開放oracle監聽埠WindowsServer防火牆Oracle
- Ubuntu下如何關閉指定埠的程式Ubuntu
- 埠開放
- 檢視Ubuntu上佔用指定埠的程序Ubuntu
- Linux 檢視對外開放埠Linux
- Linux 防火牆開放特定埠 (iptables)Linux防火牆
- 在 Linux 系統中開放埠Linux
- 如何檢查 Linux 中的開放埠列表?Linux
- 開啟linux主機的埠快速釋放Linux
- 在Linux中,如何檢視開放的埠?Linux
- Ubuntu檢視和釋放80埠Ubuntu
- linux埠釋放Linux
- linux 釋放埠Linux
- Oracle 開放埠Oracle
- CentOS7檢視開放埠命令及開放埠號CentOS
- 檢視Linux埠是否被開放@[環境部署]Linux
- linux釋放佔用埠Linux
- Linux中檢查本地系統上的開放埠列表的方法Linux
- centos 開放埠配置命令CentOS
- centos 開啟防火牆指定埠CentOS防火牆
- linux檢視埠占用及強制釋放埠Linux
- CentOS 7 開放防火牆埠CentOS防火牆
- CentOS下開放防火牆埠CentOS防火牆
- 埠碰撞技術讓開放埠更安全(轉)
- nginx指定埠開啟gzip壓縮Nginx
- win10開放埠怎樣檢視_win10檢視開放埠號的步驟Win10
- websocket的埠,阿里雲伺服器安全組開放埠Web阿里伺服器