小编Sgu*_*uit的帖子

通过以太网接口共享(wifi)互联网

我想连接两个设备,第一个是带有 ubuntu 的笔记本电脑(通过 wifi 连接到互联网),第二个是带有用 yocto 编译的 Linux 发行版的设备。这两个设备通过以太网电缆相互连接。我想要第二台设备上的互联网访问权限。在笔记本电脑上,我在 eth 接口上设置了静态 IP (192.168.3.254),并且我允许其他计算机使用 wifi 共享选项(对于 eth iface 也是如此)。在第二个设备中,我有以下等/网络/接口:

auto eth0
iface eth0 inet static
    address 192.168.3.22
    netmask 255.255.255.0
    network 192.168.3.0
    gateway 192.168.3.254
Run Code Online (Sandbox Code Playgroud)

现在我可以启动 ssh 会话,但在第二台设备上唯一有效的 ping 是 192.168.3.254。我尝试 ping 8.8.8.8 或 1.1.1.1 但没有任何结果!我做错了什么?

linux networking wifi ethernet network-interface

5
推荐指数
2
解决办法
3万
查看次数

标签 统计

ethernet ×1

linux ×1

network-interface ×1

networking ×1

wifi ×1