码迷,mamicode.com
首页 > 系统相关 > 详细

嵌入式linux开发环境搭建(一)——双网卡的网络设置

时间:2016-05-27 18:39:55      阅读:1379      评论:0      收藏:0      [点我收藏+]

标签:嵌入式 开发环境 双网卡

嵌入式linux开发环境搭建(一)——双网卡的网络设置


一、linux发行版为ubuntu-14.04.4-server-amd64版本

安装ubuntu

二、网络设置

    1、虚拟机添加双网卡

           eth0桥接无线网卡用于Ubuntu上网,eth1桥接有线网卡用于连接开发板。eth0eth1网卡设置如下图所示:


技术分享

技术分享

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.0

network 192.168.0.0

dns-nameservers 61.166.150.123
auto eth1
iface eth1 inet static
address 192.168.0.201

netmask 255.255.255.0

network 192.168.6.0
dns-nameservers 61.166.150.123

 

修改DNS配置文件/etc/resolv.conf

nameserver 61.166.150.123

 

关闭防火墙

ufw dissble

 

重启网卡

/etc/init.d/networking restart


安装openssh

apt-get install openssh-server

配置文件:/etc/ssh/sshd_config


此时就可以使用secureCRT等连接linux了。


如果此时仍然连不上外网,考虑重启系统reboot



注意:网关只能设置一个,无线网卡连接互联网,需要设置网关,有线网卡连接开发板不能设置网关







本文出自 “天山老妖” 博客,请务必保留此出处http://9291927.blog.51cto.com/9281927/1783898

嵌入式linux开发环境搭建(一)——双网卡的网络设置

标签:嵌入式 开发环境 双网卡

原文地址:http://9291927.blog.51cto.com/9281927/1783898

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!