码迷,mamicode.com
首页 > 其他好文 > 详细

ifconfig

时间:2021-04-15 12:05:52      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:alt   clear   inf   ack   strong   div   cin   ifconfig   esc   

https://blog.csdn.net/robacco/article/details/79238166

 

ifconfig eth0 192.168.80.111 netmask 255.255.255.0

 

auto lo
iface lo inet loopback
 

auto eth0  

iface eth0 inet dhcp



 

https://blog.csdn.net/weixin_43314056/article/details/83347296



 

一、设置静态IP及DHCP网络服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
kk@yuanqiangfei:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0                                                #eth0网卡开机启动
iface eth0 inet dhcp                                    #使用DHCP服务器申请动态IP
#iface eth0 inet static                                 #设置eth0网卡静态IP
#address 192.168.1.188                               #静态IP  
#netmask 255.255.255.0                               #掩码
#gateway 192.168.1.1                                  #网关  

二、修改DNS 

1
2
3
4
5
kk@yuanqiangfei:~$ cat /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.3.1
nameserver 192.168.1.1
kk@yuanqiangfei:~$ ^C
kk@yuanqiangfei:~$ resolvconf -u

查看修改是否成功: 

技术图片

修改相关参数之后重启网络:

1
sudo service networking restart

 

ifconfig

标签:alt   clear   inf   ack   strong   div   cin   ifconfig   esc   

原文地址:https://www.cnblogs.com/Janly/p/14657898.html

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