红联Linux门户
Linux帮助

ubuntu IP出现inet6 addr :fe80::20c:29ff:fe47:fd61/64 scope:l

发布时间:2016-03-26 15:21:02来源:linux网站作者:就是我

经常出现(inet6 addr :fe80::20c:29ff:fe47:fd61/64 scope:link1)这种情况的不要担心了,试试这个方法,这也是我折磨了好多天整理的,不喜勿喷,谢谢。

虚拟机设置权限: sudo chown book:book fs_mini_mdev -R

虚拟机更改IP: ifconfig eth0 192.168.0.22 


1、动态ip地址

可以修改/etc/network/interfaces文件实现动态分配ip地址

auto lo

iface lo inet loopback

auto eth3 

iface  eth3  inet  dhcp

每次启动后由路由器分配一个ip地址,然后用ifconfig命令查看当前ip地址,然后使      用sudo  ifconfig  eth3  192.168.*.***命令来设置ip地址成规划的值。

eg:book@book-desktop:~$ ifconfig

book@book-desktop:~$ sudo  ifconfig  eth3  192.168.1.184


2、静态ip地址

如果在终端中输入sudo  ifconfig  eth0 192.168.*.***的方法,只是当前登录有效,可以通过修改/etc/network/interfaces文件实现每次开机时ip地址固定。

book@book-desktop:~$ sudo  gedit  /etc/network/interfaces

增加对eth0的设置。

auto lo

iface lo inet loopback

auto eth0

iface  eth0  inet  static

address  192.168.0.***

gateway  192.168.0.1

netmask  255.255.255.0

其中,static为静态IP,设置IP地址为192.168.0.***,gateway网管位192.168.1.1,netmask子网掩码位255.255.255.0。

按下ctrl + s 保存设置,ctrl + q退出gedit的设置。


3、重启网卡、重启网络服务

先关闭然后再打开网卡,重启网络服务。

sudo  ifconfig  eth0  down

sudo  ifconfig  eth0  up

sudo  /etc/init.d/networking  restart

重启网络服务后,在终端中输入Ifconfig命令验证ip地址修改是否成功。


4、关闭ubuntu的防火墙

使用sudo ufw disable命令关闭ubuntu的防火墙。

book@book-desktop:~$ sudo ufw disable

Firewall stopped and disabled on system startup


本文永久更新地址:http://www.linuxdiyf.com/linux/19270.html