嵌入式linux开发环境搭建(一)——双网卡的网络设置
2017-03-26 12:40
447 查看
嵌入式linux开发环境搭建(一)——双网卡的网络设置一、linux发行版为ubuntu-14.04.4-server-amd64版本安装ubuntu二、网络设置 1、虚拟机添加双网卡
eth0桥接无线网卡用于Ubuntu上网,eth1桥接有线网卡用于连接开发板。eth0和eth1网卡设置如下图所示:
2、设置网络
先查看网卡:ifconfig | more如果没有显示eth0、eth1网卡,则用ifconfig eth0 up;ifconfig eth1 up激活网卡eth0、eth1.再次用ifconfig | more查看,此时显示eth0、eth1网卡。修改配置文件/etc/network/interfaces。在文件末尾添加eth0、eth1设置auto eth0
iface eth0 inet static
address 192.168.0.201
gateway 192.168.0.1 netmask 255.255.255.0network 192.168.0.0dns-nameservers 61.166.150.123
auto eth1
iface eth1 inet static
address 192.168.6.201netmask 255.255.255.0network 192.168.6.0
dns-nameservers 61.166.150.123
修改DNS配置文件/etc/resolv.confnameserver 61.166.150.123 关闭防火墙ufw disable 重启网卡/etc/init.d/networking restart
安装opensshapt-get install openssh-server配置文件:/etc/ssh/sshd_config
此时就可以使用secureCRT等连接linux了。
如果此时仍然连不上外网,考虑重启系统reboot
注意:网关只能设置一个,无线网卡连接互联网,需要设置网关,有线网卡连接开发板不能设置网关
本文出自 “生命不息,奋斗不止” 博客,请务必保留此出处http://9291927.blog.51cto.com/9281927/1783898
eth0桥接无线网卡用于Ubuntu上网,eth1桥接有线网卡用于连接开发板。eth0和eth1网卡设置如下图所示:
2、设置网络
先查看网卡:ifconfig | more如果没有显示eth0、eth1网卡,则用ifconfig eth0 up;ifconfig eth1 up激活网卡eth0、eth1.再次用ifconfig | more查看,此时显示eth0、eth1网卡。修改配置文件/etc/network/interfaces。在文件末尾添加eth0、eth1设置auto eth0
iface eth0 inet static
address 192.168.0.201
gateway 192.168.0.1 netmask 255.255.255.0network 192.168.0.0dns-nameservers 61.166.150.123
auto eth1
iface eth1 inet static
address 192.168.6.201netmask 255.255.255.0network 192.168.6.0
dns-nameservers 61.166.150.123
修改DNS配置文件/etc/resolv.confnameserver 61.166.150.123 关闭防火墙ufw disable 重启网卡/etc/init.d/networking restart
安装opensshapt-get install openssh-server配置文件:/etc/ssh/sshd_config
此时就可以使用secureCRT等连接linux了。
如果此时仍然连不上外网,考虑重启系统reboot
注意:网关只能设置一个,无线网卡连接互联网,需要设置网关,有线网卡连接开发板不能设置网关
本文出自 “生命不息,奋斗不止” 博客,请务必保留此出处http://9291927.blog.51cto.com/9281927/1783898
相关文章推荐
- 嵌入式linux开发环境搭建(一)——双网卡的网络设置
- 嵌入式linux开发环境搭建——VirtualBox虚拟机网络环境解析
- 嵌入式linux开发环境搭建——VirtualBox虚拟机网络环境解析
- 博客园 首页 新随笔 联系 订阅 管理 Ubuntu 16.04搭建LAMP开发环境 1. 配置网络环境 略 2. 设置ROOT密码 sud
- 【嵌入式Linux学习七步曲之第二篇 ARM+Linux开发环境】详解为什么开发板的TFTP、NFS等网络功能神奇消失
- eclipse在进行linux嵌入式开发时环境变量的设置问题
- 64位ubuntu16.04搭建嵌入式linux开发环境的奇葩问题
- 嵌入式Linux开发环境搭建
- 嵌入式Linux开发环境的搭建
- 搭建嵌入式Linux C/C++开发环境:eclipse + arm-linux-gcc
- 嵌入式linux应用开发完全手册学习笔记二(嵌入式linux开发环境搭建)
- 使用Vagrant在Windows平台搭建嵌入式Linux开发环境(2)Tftpd服务器搭建
- 嵌入式Linux开发环境中双网卡使用过程杂记
- 嵌入式开发第11天 (linux-c 环境搭建,命令)
- linux:嵌入式linux开发环境搭建(整理)
- Linux 下 Qt 4.6.0 嵌入式开发环境的搭建、移植
- 嵌入式应用/驱动开发网络环境设置-使用NFS网络文件系统挂载根文件系统
- Linux开发环境搭建与使用——ubuntu更新设置
- 基于qt的嵌入式Linux开发环境搭建
- 嵌入式Linux开发环境的搭建以及嵌入式入门的一些想法