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

ubuntu网络配置

时间:2019-01-08 21:10:14      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:ref   文件配置   http   inter   name   src   stat   int   网卡   

ubuntu的网络配置分为两种:图形界面配置和文件配置

1、图形界面配置

 

2、文件配置(参考:https://blog.csdn.net/qq_40682522/article/details/78269830

首先可以ifconfig查看网卡名

技术分享图片

然后打开网络配置文件/etc/network/interfaces

静态网络配置:

auto enp14s0              # 网卡名
iface enp14s0 inet static          # 静态获取IP地址
address 192.168.1.104         # 设置IP地址
gateway 192.168.1.1          # 设置网关
netmask 255.255.255.0        # 设置子网掩码
dns-nameserver 8.8.8.8 192.168.0.0     # 设置DNS域名解析,可配置多个

动态网络配置:

auto enp14s0              # 网卡名
iface enp14s0 inet dhcp        # 动态获取IP地址

然后sudo /etc/init.d/networking restart便可重新启动网络服务。

ubuntu网络配置

标签:ref   文件配置   http   inter   name   src   stat   int   网卡   

原文地址:https://www.cnblogs.com/jisongxie/p/10240956.html

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