两块网卡都连接网线设置内外网,禁用内网,有时会影外网
Tofloor
poster avatar
lihs18
deepin
2020-10-11 06:27
Author
两块网卡都连接网线设置内外网,禁用内网,有时会影外网,内网网卡好像自动启用了一样
Reply Favorite View the author
All Replies
jingle
deepin
2020-10-11 07:47
#1
控制中心设置的吗。
Reply View the author
lihs18
deepin
2020-10-12 01:43
#2
https://bbs.deepin.org/post/203634
控制中心设置的吗。

是的 单击网络图标时 禁用的那块网卡图标右侧会出现对勾 然后进入网络设置重新启用禁用后回复正常
Reply View the author
deepinuser17
deepin
2020-10-12 21:09
#3
运行以下命令:
  1. ifconfig
  2. netstat -rn
Copy the Code


看看初始网关(gateway)是设置在哪个网卡上.  如果网关是设在内网卡上, 那么问题就很清楚了.

一般网关要设在外网网卡上.
Reply View the author
lihs18
deepin
2020-10-13 05:49
#4
lihs18@lihs18-PC:~/Desktop$ ifconfig
enp2s0: flags=4099  mtu 1500
        ether 00:1e:0b:d0:ce:20  txqueuelen 1000  (Ethernet)
        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

enp5s0: flags=4163  mtu 1500
        ether 00:e0:4c:fb:bc:3b  txqueuelen 1000  (Ethernet)
        RX packets 16156  bytes 3405840 (3.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17736  bytes 4860360 (4.6 MiB)
        TX errors 0  dropped 0 overruns 3  carrier 0  collisions 0

enp6s0: flags=4163  mtu 1500
        inet 192.168.0.57  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::e4ad:2c6a:14db:ce37  prefixlen 64  scopeid 0x20
        ether 74:27:ea:14:5a:6d  txqueuelen 1000  (Ethernet)
        RX packets 612788  bytes 482002857 (459.6 MiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 245944  bytes 21555398 (20.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 23727  bytes 3393261 (3.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23727  bytes 3393261 (3.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lihs18@lihs18-PC:~/Desktop$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.0.100   0.0.0.0         UG        0 0          0 enp6s0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 enp6s0
Reply View the author
deepinuser17
deepin
2020-10-13 06:28
#5
这台机器上有三个网卡, enp2s0, enp5s0, enp6s0. 目前只有enp6s0获取了IP地址. 网关设定是enp6s0. 另外两个网卡, 没有IP地址. 是关闭了, 还是没有网线连接?

哪个是内网连接?, 哪个是外网连接?
       
Reply View the author
lihs18
deepin
2020-10-14 04:29
#6
enp2s0是光网卡 没连线  enp5s0是内网网卡 已禁用 但有时会莫名成为启用状态 但在网络设置中还是禁用的 需要在网络设置中重新启用 再禁用
Reply View the author
犇牛
deepin
2020-10-14 05:01
#7
我一般用: nmtui
Reply View the author
lihs18
deepin
2020-10-15 02:51
#8
重启后就变成这种状态
Reply View the author
lihs18
deepin
2020-10-16 05:03
#9

lihs18@lihs18-PC:~/Desktop$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.0.100   255.255.255.255 UGH       0 0          0 enp6s0
10.0.0.0        10.49.111.1     255.255.255.0   UG        0 0          0 enp5s0
10.30.0.0       192.168.0.100   255.255.0.0     UG        0 0          0 enp6s0
10.49.111.0     0.0.0.0         255.255.255.128 U         0 0          0 enp5s0
10.109.0.0      192.168.0.100   255.255.0.0     UG        0 0          0 enp6s0
133.0.0.0       10.49.111.1     255.255.255.0   UG        0 0          0 enp5s0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 enp6s0
lihs18@lihs18-PC:~/Desktop$
麻烦看看我的设置有问题吗
Reply View the author
lihs18
deepin
2020-10-17 05:58
#10
https://bbs.deepin.org/post/203634
lihs18@lihs18-PC:~/Desktop$ netstat -rn
Kernel IP routing table
Destination     Gateway         Ge ...

明白了 默认路由掩码有问题
Reply View the author