最近换到了 Ubuntu 20.04 ,做了如下设置。
IP:
xxx@xxx:~$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0:
mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 04:bf:1b:80:06:4b brd ff:ff:ff:ff:ff:ff
inet 192.168.1.26/16 brd 192.168.255.255 scope global noprefixroute enp3s0
valid_lft forever preferred_lft forever
inet6 fe80::b31c:c7f4:6bca:b597/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlp0s20f3:
mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 74:3a:f4:68:ab:50 brd ff:ff:ff:ff:ff:ff
4: docker0:
mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:9f:c4:78:0b brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:9fff:fec4:780b/64 scope link
valid_lft forever preferred_lft forever
6: veth5f39922@if5:
mtu 1500 qdisc noqueue master docker0 state UP group default
link/ether ba:ba:dd:9b:cc:03 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::b8ba:ddff:fe9b:cc03/64 scope link
valid_lft forever preferred_lft forever
关闭 ufw:
sudo ufw disable
sudo systemctl stop ufw
sudo systemctl disable ufw
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -F
sudo netfilter-persistent save
Ubuntu 上启动了一个 fastapi 的项目,本机通过 localhost 或者 ip 都可以访问。
现在内网其他设备可以 ping 通 Ubuntu ,但是所有端口都无法访问,请问可能是什么原因或者如何排查?