我有一个Raspberry Pi Zero
(没有 WIFI 适配器)通过连接USB
到Raspberry 3B+
具有 Internet 访问权限的服务器(以及eth0
和wlan0
)。我能够通过 ssh 进入raspberry zero
,甚至可以建立IP
串行连接,但是无法访问互联网。
有没有一种方法可以让我从 Raspberry 重定向或共享互联网并访问通过 所连接的互联网USB
?
我关注了这个博客:https://blog.gbaman.info/?p=791 我还在这里写了一些步骤:https://github.com/programandoconro/My-Linux-Locker-/blob/master/Raspberry/USB_serial.sh。
万分感谢,
编辑:这些是之后的结果
ifconfig -a
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.181.179 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 ************* prefixlen 64 scopeid 0x20<link>
ether ************* txqueuelen 1000 (Ethernet)
RX packets 85 bytes 10991 (10.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 68 bytes 11207 (10.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
...和ip route ls
:
default dev usb0 scope link src 169.254.181.179 metric 202
169.254.0.0/16 dev usb0 scope link src 169.254.181.179 metric 202