博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu固定IP地址
阅读量:2359 次
发布时间:2019-05-10

本文共 435 字,大约阅读时间需要 1 分钟。

ubuntu固定IP地址
编辑/etc/network/interfaces文件
将:
auto eth0
iface eth0 inet dhcp
改为:
auto eth0
iface eth0 inet static
address 你要设定的ip地址
netmask
网关通过命令ifconfig可以查看到
gateway 掩码通过命令route -n可以查看到
重新连线:
$sudo /etc/init.d/networking restart
上面的netmask和gateway用下面命令可以察知:
查看掩码:
$ifconfig
查看网关:
$route -n
(destination Genmask都是0.0.0.0的那行当Gateway)
如果过一段时间的ip地址又变了,可能是interfaces被改变了
你需要用下面的命令锁定/etc/network/interfaces
$chattr +i /etc/network/interfaces

转载地址:http://dhntb.baihongyu.com/

你可能感兴趣的文章
python的Pattern模块
查看>>
关于hive同一个脚本运行多次而每次结果都不相同
查看>>
File类
查看>>
文件流的输入输出
查看>>
LineNumberReader:记录行号的流
查看>>
Properties,Runtime,SimpleDateFormat,Calendar
查看>>
Math,Random
查看>>
InetAddress,UDP, TCP
查看>>
mysql常用数据类型
查看>>
数据库简介
查看>>
数据库操作
查看>>
JDBC
查看>>
MySql存储过程
查看>>
事务,连接池,异常的使用
查看>>
使用元数据+反射优化CURD操作+DBUtils
查看>>
Install MongoDB Enterprise on Red Hat Enterprise or CentOS
查看>>
MongoDB 聚合管道(一)(Aggregation Pipeline)
查看>>
MongoDB 聚合管道(二)(Aggregation Pipeline)
查看>>
Groovy创建和解析json
查看>>
使用Groovy操作文件
查看>>