主页 路由器 NAT 网络配置 Ubuntu 20.04

主页 路由器 NAT 网络配置 Ubuntu 20.04

我有 Ubuntu 20.04 桌面和家庭路由器,我正在尝试打开端口以便从互联网进行访问。

这是接口信息

1: lo: <LOOPBACK,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d8:cb:8a:5d:85:c6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.178/24 brd 192.168.0.255 scope global dynamic noprefixroute enp3s0
       valid_lft 5381sec preferred_lft 5381sec
    inet6 fe80::dacb:8aff:fe5d:85c6/64 scope link 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:35:a8:08:5d 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

网络计划

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp3s0:
      dhcp4: yes

在 Ubuntu 上,我已使用 UFW 打开端口

ufw status
Status: active

To                         Action      From
--                         ------      ----
80/tcp                     ALLOW       Anywhere                  
443/tcp                    ALLOW       Anywhere                  
22/tcp                     ALLOW       Anywhere                  
21/tcp                     ALLOW       Anywhere                  
7080                       ALLOW       Anywhere                  
8080                       ALLOW       Anywhere                  
8443                       ALLOW       Anywhere                  
3306                       ALLOW       Anywhere                  
80/tcp (v6)                ALLOW       Anywhere (v6)             
443/tcp (v6)               ALLOW       Anywhere (v6)             
22/tcp (v6)                ALLOW       Anywhere (v6)             
21/tcp (v6)                ALLOW       Anywhere (v6)             
7080 (v6)                  ALLOW       Anywhere (v6)             
8080 (v6)                  ALLOW       Anywhere (v6)             
8443 (v6)                  ALLOW       Anywhere (v6)             
3306 (v6)                  ALLOW       Anywhere (v6)             

在我的路由器上,我已将端口转发到 192.168.0.178 Ubuntu 桌面nat转发端口到虚拟服务器

当我在 VirtualBox 上使用 Windows 10 和 Ubuntu 时,连接正常。

尝试从笔记本电脑 ssh 192.168.0.178,但没有成功。

但端口仍处于关闭状态,我无法通过 SSH 连接到我的 Ubuntu 20.04。请帮帮我 :*(

相关内容