【ubuntu】配置固定ip
2017-10-21 20:28
183 查看
参考:https://jingyan.baidu.com/article/e5c39bf5bbe0e739d7603396.html
1,终端 ifconfig确定网卡名称,一般为eth0
2,root用户登录
3,vim /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.2.121
netmask 255.255.255.0
gateway 192.168.2.1
##其中address,netmask,gateway分别和ifconfig中eth0中的addr,mask,bcast相对应
4,vim /etc/resolv.conf
添加:
nameserver 192.168.2.1
nameserver 220.170.64.68(百度输入ip直接会显示外网ip)
5,vim /etc/resolvconf/resolv.conf.d/base
添加:
nameserver 192.168.2.1
nameserver 220.170.64.68
6,sudo service network-manager restart
或者:sudo /etc/init.d/networking restart
7,配置ssh及端口
http://blog.csdn.net/zht666/article/details/9340633
**********手动固定ip配置***********
http://service.tp-link.com.cn/detail_article_1418.html
注:此处设置的地址,子网掩码等和上面的相同。
1,终端 ifconfig确定网卡名称,一般为eth0
2,root用户登录
3,vim /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.2.121
netmask 255.255.255.0
gateway 192.168.2.1
##其中address,netmask,gateway分别和ifconfig中eth0中的addr,mask,bcast相对应
4,vim /etc/resolv.conf
添加:
nameserver 192.168.2.1
nameserver 220.170.64.68(百度输入ip直接会显示外网ip)
5,vim /etc/resolvconf/resolv.conf.d/base
添加:
nameserver 192.168.2.1
nameserver 220.170.64.68
6,sudo service network-manager restart
或者:sudo /etc/init.d/networking restart
7,配置ssh及端口
http://blog.csdn.net/zht666/article/details/9340633
**********手动固定ip配置***********
http://service.tp-link.com.cn/detail_article_1418.html
注:此处设置的地址,子网掩码等和上面的相同。
相关文章推荐
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- VM中的Ubuntu配置置固定IP(NAT方式)
- Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- 转 -- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Linux之Ubuntu固定IP配置
- 基于Ubuntu 18.04配置固定IP的方法教程
- ubuntu下docker固定IP配置及桥接
- Ubuntu14.04下配置固定IP
- Ubuntu16.04桥接下如何配置固定IP
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)(转载)
- Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Ubuntu14.04下如何配置固定IP
- VMware虚拟机内安装的Ubuntu 16.04设置静态IP地址 spark2.0集群固定IP配置
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Ubuntu14.04下如何配置固定IP
- Ubuntu 有线连接路由固定ip配置
- ubuntu 配置固定ip
- VMware虚拟机内安装的Ubuntu 16.04设置静态IP地址 spark2.0集群固定IP配置
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)