您的位置:首页 > 理论基础 > 计算机网络

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

2016-05-27 18:11 651 查看
嵌入式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

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

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息