Oracle Cloud的VPS Ubuntu18.04开放端口

Oracle的VPS Ubuntu系统开放端口

在网络安全规则中添加端口

Fill in the ingress rule as follows:

Stateless: Checked
Source Type: CIDR
Source CIDR: 0.0.0.0/0
IP Protocol: TCP
Source port range: (leave-blank)
Destination Port Range: 80
Description: Allow HTTP connections
Once you click Add Ingress Rule, HTTP connections are allowed. Your VCN is configured for Apache server.

具体步骤参见参考链接

在系统中使用iptables开放端口

使用命令查看INPUT链的numsudo iptables -L --line

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    xx  tcp  --  anywhere             anywhere             tcp dpt:mysql
2    xx  tcp  --  anywhere
sudo iptables -I INPUT 3 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 4 -m state --state NEW -p udp --dport 80 -j ACCEPT

sudo netfilter-persistent save

INPUT 3是上个命令num序号后依次增加,如果序号已存在会覆盖原有的规则!!!

你可能感兴趣的