ubuntu下双网卡,如何选择第二张网卡上网?

aree 2018-06-11 03:15:40
哪位兄弟能帮忙检查一下。
ubuntu下双网卡,如何选择第二张网卡上网?第一个网站走内网,第二张走外网。

配置如下:

root@ubuntu:/etc# ifconfig
eno1 Link encap:Ethernet HWaddr 45:69:c6:3f:b4:6e
inet addr:10.92.35.225 Bcast:10.92.35.255 Mask:255.255.255.0
inet6 addr: fe80::f12b:321c:9a85:bc65/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:266904448 errors:0 dropped:0 overruns:0 frame:0
TX packets:249582652 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:324687451815 (324.6 GB) TX bytes:215951829090 (215.9 GB)
Interrupt:20 Memory:f7c00000-f7c20000

enp0s20u1 Link encap:Ethernet HWaddr 9b:26:03:3c:67:e3
inet addr:192.168.42.11 Bcast:192.168.42.255 Mask:255.255.255.0
inet6 addr: fe80::7eca:1daa:da3:398a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2402 errors:0 dropped:0 overruns:0 frame:0
TX packets:3215 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:233239 (233.2 KB) TX bytes:463146 (463.1 KB)

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:69465629 errors:0 dropped:0 overruns:0 frame:0
TX packets:69465629 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:15830765569 (15.8 GB) TX bytes:15830765569 (15.8 GB)

root@ubuntu:/etc# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.92.35.1 0.0.0.0 UG 100 0 0 eno1
0.0.0.0 192.168.42.129 0.0.0.0 UG 101 0 0 enp0s20u1
10.92.32.6 10.92.35.1 255.255.255.255 UGH 100 0 0 eno1
10.92.35.0 0.0.0.0 255.255.255.0 U 100 0 0 eno1
192.168.42.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s20u1
192.168.42.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s20u1


-----------------
root@ubuntu:/etc# vi /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

auto eth0
iface eth0 inet static
address 10.92.35.225
netmask 255.255.255.0

iface eth1 inet static
address 192.168.42.11
netmask 255.255.255.0
gateway 192.168.42.129
auto eth1



root@ubuntu:/etc# /etc/init.d/networking restart
[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.
failed!
上面这个,启动一直失败failed

是不是 vi /etc/network/interfaces 哪里配置错误了?

...全文
1960 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

1,322

社区成员

发帖
与我相关
我的任务
社区描述
网络维护与管理相关内容讨论专区
网络网络安全安全 技术论坛(原bbs)
社区管理员
  • 网络维护与管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧