我想通过交叉电缆连接我的两台在 2.6 内核中运行的 Linux PC。为此,我在 Google 搜索后进行了以下设置:
在 PC1
ifconfig eth0 10.10.11.16 netmask 255.255.255.0 up
route add default gw 10.10.11.13 eth0
(默认网关是 pc2 的 ip )在 PC2
ifconfig eth0 10.10.11.13 netmask 255.255.255.0 up
route add default gw 10.10.11.16 eth0
(默认网关是 pc1 的 ip )然后我尝试 ping 我无法连接。以上这些设置是否足够或我缺少任何东西?
为您提供更多信息
在 PC1
ifconfig 输出
eth0 Link encap:Ethernet HWaddr 00:16:76:A1:33:37
inet addr:10.10.11.16 Bcast:10.10.11.255 Mask:255.255.255.0
inet6 addr: fe80::216:76ff:fea1:3337/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:49984 errors:6 dropped:0 overruns:0 frame:6
TX packets:17221 errors:0 …
Run Code Online (Sandbox Code Playgroud) linux ×1