PC上测试

Ubuntu 16.04 本身已经支持双网卡同时工作,使用route命令查看时可以看到,目前无线网卡有线网卡已经同时在工作,其中wlp2s0无线网卡enxa44cc8f621d9有线网卡

tony@pc:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         localhost       0.0.0.0         UG    100    0        0 enxa44cc8f621d9
default         localhost       0.0.0.0         UG    600    0        0 wlp2s0
link-local      *               255.255.0.0     U     1000   0        0 wlp2s0
172.16.1.0      *               255.255.255.0   U     0      0        0 vmnet1
192.168.1.0     *               255.255.255.0   U     100    0        0 enxa44cc8f621d9
192.168.43.0    *               255.255.255.0   U     600    0        0 wlp2s0
192.168.212.0   *               255.255.255.0   U     0      0        0 vmnet8
tony@pc:~$ 

前两个default默认网关,实际连接的话,有线网卡网卡能上外网,无线网卡只是一个局域内网。由于有这一行,系统在能正常通过有线网卡访问外网的同时,也可以通过无线网卡访问192.168.43.0号段的局域内网。

192.168.43.0    *               255.255.255.0   U     600    0        0 wlp2s0

做一个测试,其中baidu.com是外网,可以如下正常ping通。


tony@pc:~$ ping baidu.com
PING baidu.com (111.13.101.208) 56(84) bytes of data.
64 bytes from 111.13.101.208: icmp_seq=1 ttl=52 time=4.23 ms
64 bytes from 111.13.101.208: icmp_seq=2 ttl=52 time=3.75 ms
64 bytes from 111.13.101.208: icmp_seq=3 ttl=52 time=3.80 ms
64 bytes from 111.13.101.208: icmp_seq=4 ttl=52 time=4.38 ms
^C
--- baidu.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 3.750/4.044/4.382/0.281 ms

其中192.168.43.37是局域内网下的一个设备,同样可以ping通,如下。

tony@pc:~$ ping 192.168.43.37
PING 192.168.43.37 (192.168.43.37) 56(84) bytes of data.
64 bytes from 192.168.43.37: icmp_seq=1 ttl=64 time=468 ms
64 bytes from 192.168.43.37: icmp_seq=2 ttl=64 time=80.8 ms
64 bytes from 192.168.43.37: icmp_seq=3 ttl=64 time=204 ms
64 bytes from 192.168.43.37: icmp_seq=4 ttl=64 time=25.3 ms
64 bytes from 192.168.43.37: icmp_seq=5 ttl=64 time=45.0 ms
64 bytes from 192.168.43.37: icmp_seq=6 ttl=64 time=67.8 ms
^C
--- 192.168.43.37 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 25.310/148.657/468.156/153.996 ms
tony@pc:~$ 

NanoPC-T2 Linux 上测试

连接上WiFi和以太网后,route就自动配置好了,如下所示,且ping外网和内网时可同时使用。

pi@FriendlyELEC:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr ca:ef:1f:c4:4e:ce  inet addr:192.168.1.124  Bcast:192.168.1.255  Mask:255.255.255.0inet6 addr: fe80::8e3b:4240:cd32:eea6/64 Scope:LinkUP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1RX packets:2281 errors:0 dropped:0 overruns:0 frame:0TX packets:781 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:462086 (462.0 KB)  TX bytes:70968 (70.9 KB)Interrupt:64 Base address:0x4000 lo        Link encap:Local Loopback  inet addr:127.0.0.1  Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING  MTU:65536  Metric:1RX packets:1297 errors:0 dropped:0 overruns:0 frame:0TX packets:1297 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1 RX bytes:109194 (109.1 KB)  TX bytes:109194 (109.1 KB)wlan0     Link encap:Ethernet  HWaddr b0:f1:ec:29:06:18  inet addr:192.168.43.53  Bcast:192.168.43.255  Mask:255.255.255.0inet6 addr: fe80::20ff:6245:96eb:1993/64 Scope:LinkUP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1RX packets:112 errors:0 dropped:1264 overruns:0 frame:0TX packets:522 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:18279 (18.2 KB)  TX bytes:90094 (90.0 KB)pi@FriendlyELEC:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         localhost       0.0.0.0         UG    100    0        0 eth0
default         localhost       0.0.0.0         UG    600    0        0 wlan0
192.168.1.0     *               255.255.255.0   U     100    0        0 eth0
192.168.43.0    *               255.255.255.0   U     600    0        0 wlan0
pi@FriendlyELEC:~$ ping 192.168.43.85
PING 192.168.43.85 (192.168.43.85) 56(84) bytes of data.
64 bytes from 192.168.43.85: icmp_seq=1 ttl=64 time=87.4 ms
64 bytes from 192.168.43.85: icmp_seq=2 ttl=64 time=105 ms
64 bytes from 192.168.43.85: icmp_seq=3 ttl=64 time=27.0 ms
64 bytes from 192.168.43.85: icmp_seq=4 ttl=64 time=49.7 ms
64 bytes from 192.168.43.85: icmp_seq=5 ttl=64 time=95.5 ms
64 bytes from 192.168.43.85: icmp_seq=6 ttl=64 time=96.0 ms
64 bytes from 192.168.43.85: icmp_seq=7 ttl=64 time=17.3 ms
^C
--- 192.168.43.85 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6003ms
rtt min/avg/max/mdev = 17.389/68.420/105.762/33.631 ms
pi@FriendlyELEC:~$ ^C
pi@FriendlyELEC:~$
pi@FriendlyELEC:~$
pi@FriendlyELEC:~$ ping 202.108.22.5
PING 202.108.22.5 (202.108.22.5) 56(84) bytes of data.
64 bytes from 202.108.22.5: icmp_seq=1 ttl=57 time=2.22 ms
64 bytes from 202.108.22.5: icmp_seq=2 ttl=57 time=1.97 ms
64 bytes from 202.108.22.5: icmp_seq=3 ttl=57 time=1.85 ms
64 bytes from 202.108.22.5: icmp_seq=4 ttl=57 time=2.29 ms
^C
--- 202.108.22.5 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.856/2.086/2.296/0.182 ms
pi@FriendlyELEC:~$ 
  1. localhost是什么意思?
    使用busybox route查看,不再是localhost了,这个应该更准确一点,更清晰了,这样设置就对了。
pi@FriendlyELEC:~$ busybox route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.1     0.0.0.0         UG    100    0        0 eth0
default         192.168.43.1    0.0.0.0         UG    600    0        0 wlan0
192.168.1.0     *               255.255.255.0   U     100    0        0 eth0
192.168.43.0    *               255.255.255.0   U     600    0        0 wlan0
pi@FriendlyELEC:~$ 
  1. https://zhidao.baidu.com/question/43482647.html
    https://zhidao.baidu.com/question/256198410.html
    https://blog.csdn.net/an_zhenwei/article/details/37883843
    https://blog.csdn.net/hshl1214/article/details/53103790

Ubuntu 16.04 双网卡 同时上内外网相关推荐

  1. WIN7使用手机蓝牙共享网络,及利用蓝牙及WLAN实现双网卡同时上内外网

    步骤1:手机先打开蓝牙,并开启"蓝牙网络共享"选项(我的是小米,其它手机不清楚有没有这个选项,有就必须打开) 步骤2:笔记本win7系统电脑如何通过蓝牙连接手机上网:http:// ...

  2. 双网卡同时上内外网的方法

    作者:iamlaosong  不少公司都有内部的专网,比如银行.税务等都有自己的内部专网,日常工作中经常会碰到需要同时访问内外网的问题,比如在内网上干活,外网上查资料,或者和其他人交换信息等,这时,可 ...

  3. win7操作系统双网卡同时上内外网

    一般的公司网络,公司的服务器在内网,员工办公在外网,两者是分开的,如笔者在银行工作,平时要连公司的测试环境就得连网线,要上外网就得连wifi,不能同时用,非常麻烦 但是也有一些公司(比如我之前的公司) ...

  4. Windows路由表配置:双网卡同时上内外网

    原文来自:http://www.cnblogs.com/lightnear/archive/2013/02/03/2890835.html 一.windows 路由表解释 route print -4 ...

  5. windows使用双网卡同时上内外网

    首先你的机器需要有两块网卡,分别接到两台交换机上, internet地址:192.168.1.8,子网掩码:255.255.255.0,网关:192.168.1.1 内部网地址:172.23.1.8, ...

  6. 双网卡同时上网如何设置 双网卡同时上内外网络

    双网卡同时使用(一个上内网,一个上外网),这样即可有效的保障内网的安全,又能解决电脑访问外网的问题.可谓是一举两得,那么那么双网卡同时上内外网怎么设置?电脑上需要安装两个网卡,分别接到两个路由上.由于 ...

  7. w10安装ubuntu_Win10 + Ubuntu 16.04双系统完美安装教程【详细】

    务必记得备份自己的数据,数据无价!!! 电脑型号:Thinkpad E550 固态装了win10,机械硬盘打算装Ubuntu16.04 固态硬盘格式MBR,机械硬盘格式GPT 一.制作U启动盘 1.下 ...

  8. 安装win 7 + ubuntu 16.04 双系统安装

    安装win 7 + ubuntu 16.04 双系统安装 安装windows 7 1. 下载windows 7镜像文件 2. 制作u盘启动盘 3. 激活win 7系统 4. 安装无线网卡驱动 5. 安 ...

  9. WIN10 + Ubuntu 16.04 双系统安装教程

    WIN10 + Ubuntu 16.04 双系统安装教程 最近老婆大人需要用到Linux系统上学习Node.Js,而她又讨厌虚拟机的卡顿,为了满足她的要求,在已装WIN10的机器上再装一个16.04版 ...

  10. thinkpad装linux双系统,ThinkPad T460P 安装 Win10 Ubuntu 16.04 双系统

    二.[制作Ubuntu 16.04启动盘] 1.因为是个人使用且不是用作服务器,为了系统安全起见,推荐到Ubuntu官网下载Ubuntu 16.04 桌面版. 本人下载的版本为ubuntu-16.04 ...

最新文章

  1. UVA1108 Mining Your Own Business(思维、割点)(2011 ICPC - WorldFinal)
  2. 页面滑动至某处,固定导航。
  3. IL 汇编学习笔记(三)
  4. Computing--状态机
  5. C++中的引用(257BinaryTreePath)
  6. 使用 Python 制作属于自己的 PDF 电子书
  7. Spring IoC(一)IoC容器的设计与实现:BeanFactory与ApplicationContext
  8. 细说 | 失效的private修饰符
  9. [转]Git使用基础篇
  10. 黑苹果AX201网卡驱动小白教程,小新pro13不换网卡也能上网!
  11. MATLAB函数unidrnd简介
  12. latex补集怎么打
  13. 案例——蚂蚁金服初探,唯一的金融互联网生态
  14. Excel不能自动求和的可能原因
  15. 美团后台开发暑期实习面经(一面+二面)已offer
  16. 图像生成论文阅读:GLIDE算法笔记
  17. 有关计算机的英语诗歌带翻译,经典的著名英语短诗歌带翻译
  18. 【QQ空间】网名大全
  19. 临河三中宏志班2021年高考成绩查询,临河三中名教师简介一
  20. 毕业5年,我问遍了身边的大佬,总结了他们的学习方法

热门文章

  1. 用C#语言实现记事本(代码)
  2. 使用sql语句直接修改数据库密码的解决方案
  3. 少量代码完成火山图绘制
  4. ios识别人脸自动拍照_iOS 相机流人脸识别(一)-人脸框检测(基于iOS原生)
  5. 服务器pe系统ghost系统安装教程,科技教程:U盘PE启动安装GHOST系统图文教程
  6. 黑马Python笔记4
  7. Bzoj1001 [BeiJing2006]狼抓兔子
  8. Ubuntu下libmodbus的应用
  9. 【WinHex篇】WinHex磁盘克隆教程
  10. 新手玩荔枝派 f1c100s nano折腾笔记(四)