JZ2440开发笔记(4)——设置静态IP
1. 配置静态ip地址
$sudo vim /etc/network/interfaces
原有内容只有如下两行:
auto lo
iface lo inet loopback
向末尾追加以下内容:
auto eth0
iface eth0 inet static
address 192.168.1.33
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168..255
然后保存退出;
2. 手动配置 dns(这个文件为动态的DNS重启后会恢复默认)
$sudo vim /etc/resolv.conf
想末尾追加如下内容:
nameserver 192.168.1.1
然后保存退出。
3. 重启 network 使修改生效
$sudo /etc/init.d/networking restart
这里有点有问题,就是重启ubuntu后,发现又不能上网了,问题出在 /etc/resolv.conf。重启后,此文件配置的dns又被自动修改为默认值。所以需要永久性修改DNS。方法如下:
方法一: 在/etc/network/interfaces 加上dns-nameservers 8.8.8.8
方法二:/etc/resolvconf/resolv.conf.d/base插入nameserver 8.8.8.8 nameserver 8.8.4.4
保存 resolvconf -u 查看 cat /etc/resolv.conf
vim /etc/resolvconf/resolv.conf.d/base
cd /etc/resolvconf/resolv.conf.d/
# cat base
nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
JZ2440开发笔记(4)——设置静态IP的更多相关文章
- Linux_笔记_01_设置静态IP与 SecureCRT连接Linux
步骤一至三,即可设置好静态IP 步骤四至九,使SecureCRT连接Linux 步骤一:编辑ifcfg-eth0 文件 1.打开ifcfg-eth0 文件 使用命令:vi /etc/sysconfig ...
- TX2开发板Ubuntu16.04设置静态IP
TX2开发板Ubuntu16.04设置静态IP https://www.cnblogs.com/qilai/p/11285445.html 首先打开一个Terminal输入 ifconfig 查看自 ...
- 在linux中设置静态ip地址
在linux中设置静态ip地址1.在终端中输入:vi /etc/sysconfig/network-scripts/ifcfg-eth0 2.开始编辑,填写ip地址.子网掩码.网关.DNS等[root ...
- CentOS 6.5、6.7 设置静态 ip 教程
CentOS 6.5.6.7 设置静态 ip 教程,可以ping通外网:www.baidu.com ①. 网络适配器(VMware Network Adapter) 选择NAT模式 ②. 设置静态 i ...
- 在ubuntu14.04设置静态ip
打开网络的配置文件 sudo vim /etc/network/interfaces 选择网卡,我这里是有线网卡eth0,设置静态ip为192.168.1.108 auto eth0 iface et ...
- 为Linux服务器设置静态IP的方法
这里以CentOS 7系列为例设置静态IP,原来RedHat系列的Linux发行版可以通过setup工具方便的设置静态IP,但是在版本7之后setup工具的功能就逐渐减弱了,所以这时候采用修改配置文件 ...
- CentOs 设置静态IP 方法
在做项目时由于局域网采用自动获取IP的方式,导到每次服务器重启主机IP都会变化. 为了解决这个问题,需要设置静态IP. 1.修改网卡配置 编辑:vi /etc/sysconfig/network-sc ...
- Ubuntu中设置静态IP和DNS
在Ubuntu中设置静态IP共两步:1>设置IP:2>设置DNS1>设置IP 编辑 /etc/network/interface文件: sudo vi /etc/n ...
- CentOS 6.5设置静态IP教程 并且可以ping通
CentOS6.5掉电或重启,它的IP会被DHCP重新分配,如果要远程控制这台电脑,不得不去打开显示器去查看它的新IP,这样太麻烦了.于是需要将这台电脑的IP设置成静态的. 网上常规的设置静态ip的方 ...
- Linux设置静态IP
在做项目时由于公司局域网采用自动获取IP的方式,导到每次服务器重启主机IP都会变化.为了解决这个问题,我参考了http://blog.sina.com.cn/s/blog_537977e50100qh ...
随机推荐
- Git权威指南 读笔(2)
第七章 Git重置: Git提供了一个挽救机制,通过.git/logs目录下日志文件记录了分支的变更. master分支的日志文件.git/logs/refs/heads/master,显示最后5行: ...
- Catch Application Exceptions in a Windows Forms Application
You need to handle the System.Windows.Forms.Application.ThreadException event for Windows Forms. Thi ...
- nodejs child process
//Create child processvar thread = require('child_process'); var msg = thread.fork(__dirname + '/chi ...
- vs git .ignore
## Ignore Visual Studio temporary files, build results, and## files generated by popular Visual Stud ...
- mysql的错误:The server quit without updating PID file /usr/local/mysql/data/door.pid).
mysql错误解决: 先 参考:http://www.jb51.net/article/48625.htm 参考第四条: mysql在启动时没有指定配置文件时会使用/etc/my.cnf配置文件,请打 ...
- 自适应网页设计(Responsive Web Design)(转)
随着3G的普及,越来越多的人使用手机上网. 移动设备正超过桌面设备,成为访问互联网的最常见终端.于是,网页设计师不得不面对一个难题:如何才能在不同大小的设备上呈现同样的网页? 手机的屏幕比较小,宽度通 ...
- [转载]C# 中对html 标签过滤
private string FilterHTML(string html) { System.Text.RegularExpressions.Regex regex1 = new System.Te ...
- Es索引优化
https://www.elastic.co/guide/en/elasticsearch/guide/current/hardware.html https://www.elastic.co/gui ...
- easyui源码翻译1.32--ComboBox(下拉列表框)
前言 扩展自$.fn.combo.defaults.使用$.fn.combobox.defaults重写默认值对象.下载该插件翻译源码 下拉列表框显示一个可编辑文本框和下拉式列表,用户可以选择一个值或 ...
- javaweb学习总结(三十四)——使用JDBC处理MySQL大数据
一.基本概念 大数据也称之为LOB(Large Objects),LOB又分为:clob和blob,clob用于存储大文本,blob用于存储二进制数据,例如图像.声音.二进制文等. 在实际开发中,有时 ...