分配静态 IP 后无法通过 SSH 访问 Debian 实例

分配静态 IP 后无法通过 SSH 访问 Debian 实例

我有一个将遥测数据发布到远程服务器的设备。该设备运行 Debian,到目前为止,我一直通过 WiFi 通过本地网络进行 SSH 调试。在现场,该设备将使用 4G 调制解调器,并且我已让 ISP 为设备分配静态 IP,以便进行远程故障排除。 4G 调制解调器正在工作以连接到互联网 - 我可以 ping 网站等 - 但每次我尝试通过 SSH 连接到静态 IP 时都会超时。我确定我错误配置了 /etc/dhcpcd.conf 或 /etc/network/interfaces,但我不确定是哪一个。接口是eth1.

如果配置:

eth1      Link encap:Ethernet  HWaddr 00:15:ff:13:77:70  
          inet addr:166.123.123.123  Bcast:166.123.123.255  Mask:255.255.255.0
          inet6 addr: fe80::deef:4034:ff93:d78/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:65 errors:0 dropped:0 overruns:0 frame:0
          TX packets:153 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5310 (5.1 KiB)  TX bytes:21669 (21.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:4d:e4:26  
          inet addr:10.0.1.90  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::29c6:be79:e368:d066/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21633 errors:0 dropped:14440 overruns:0 frame:0
          TX packets:1597 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3120767 (2.9 MiB)  TX bytes:259096 (253.0 KiB)

/etc/network/interfaces(/etc/network/interfaces.d 为空)

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/dhcpcd.conf

hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
#option interface_mtu
require dhcp_server_identifier
slaac private
nohook lookup-hostname

路由表:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         123.sub-166-123 0.0.0.0         UG    204    0        0 eth1
default         10.0.1.1        0.0.0.0         UG    303    0        0 wlan0
10.0.1.0        *               255.255.255.0   U     303    0        0 wlan0
166.123.123.0   *               255.255.255.0   U     204    0        0 eth1
my.usb          123.sub-166-123 255.255.255.255 UGH   204    0        0 eth1

答案1

如果有人在 Google 上找到此内容,请为后代提供:

该问题与盒子上的网络配置无关;在过去两个月中,Verizon 制定了一项政策来阻止 M2M 设备的传入连接。如果您需要通过蜂窝连接远程访问设备,则需要与 Verizon 合作设置专用网络。

相关内容