当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 7 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 求助,ub下修改ip地址问题
帖子发表于 : 2017-03-16 10:56 

注册: 2017-03-16 10:39
帖子: 4
系统: win10
送出感谢: 0 次
接收感谢: 0 次
在/etc/network/interfaces

下修改了ip地址,网关
居然用ifconfig查看是只变了ip,没有变化网管
之前是192.168.1.16,gw:192.168.1.1
修改为192.168.0.16,gw:192.168.0.1
但是查看的时候不一样;

eth0 inet 192.168.0.16 Bcast:192.168.1.255 mask:255.255.255.0


这里的bcast 不该变成192.168.0.255吗!!!!,现在看的还是修改之前的那个地址!!
:Sad :Sad :Sad :Sad


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 求助,ub下修改ip地址问题
帖子发表于 : 2017-03-16 11:29 

注册: 2017-03-16 10:39
帖子: 4
系统: win10
送出感谢: 0 次
接收感谢: 0 次
请大虾们帮我一下啦,什么情况呢。。。。/etc/network/interfaces
中静态地址明明是192.168.0.1,怎么ifconfig查看的时候还是原来的呢!


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 求助,ub下修改ip地址问题
帖子发表于 : 2017-03-16 11:34 

注册: 2009-08-04 16:33
帖子: 16899
送出感谢: 21
接收感谢: 1829
引用:
/etc/network/interfaces

把下面的指令 複製 貼進終端機 執行
1. sudo cat /etc/network/interfaces
2. sudo ifconfig -a
3. sudo route -n -v
把結果 直接全部複製貼上來


页首
 用户资料  
 
4 楼 
 文章标题 : Re: 求助,ub下修改ip地址问题
帖子发表于 : 2017-03-16 12:18 

注册: 2017-03-16 10:39
帖子: 4
系统: win10
送出感谢: 0 次
接收感谢: 0 次
root@nuc-1:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo eth0 eth0:1
iface lo inet loopback


iface eth0 inet static
address 192.168.0.16
netmask 255.255.254.0
gateway 192.168.0.1

iface eth0:1 inet static
address 10.2.0.2
netmask 255.255.255.0
root@nuc-1:~#
root@nuc-1:~# ifconfig -a
docker0 Link encap:Ethernet HWaddr 02:42:e9:a5:1a:5e
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

eth0 Link encap:Ethernet HWaddr b8:ae:ed:e9:a7:f1
inet addr:192.168.0.16 Bcast:192.168.1.255 Mask:255.255.254.0
inet6 addr: fe80::baae:edff:fee9:a7f1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:346803 errors:0 dropped:2 overruns:0 frame:0
TX packets:4078 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:23438187 (23.4 MB) TX bytes:374607 (374.6 KB)
Interrupt:20 Memory:aa100000-aa120000

eth0:1 Link encap:Ethernet HWaddr b8:ae:ed:e9:a7:f1
inet addr:10.2.0.2 Bcast:10.2.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:aa100000-aa120000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:31320 errors:0 dropped:0 overruns:0 frame:0
TX packets:31320 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:23564363 (23.5 MB) TX bytes:23564363 (23.5 MB)

wlan0 Link encap:Ethernet HWaddr 00:21:5c:d3:75:75
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
root@nuc-1:~# route -n -v
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
10.2.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
root@nuc-1:~#


页首
 用户资料  
 
5 楼 
 文章标题 : Re: 求助,ub下修改ip地址问题
帖子发表于 : 2017-03-16 14:29 

注册: 2009-08-04 16:33
帖子: 16899
送出感谢: 21
接收感谢: 1829
你是想設定這個嗎 ?

https://philipzheng.gitbooks.io/docker_ ... d_network/

图片
引用:
/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo eth0 eth0:1
iface lo inet loopback
iface eth0 inet static
address 192.168.0.16
netmask 255.255.254.0
gateway 192.168.0.1
iface eth0:1 inet static
address 10.2.0.2
netmask 255.255.255.0

你如此設定的資料 如果有參考什麼網頁 請提供網址 可以節省一些時間


页首
 用户资料  
 
6 楼 
 文章标题 : Re: 求助,ub下修改ip地址问题
帖子发表于 : 2017-03-16 18:56 

注册: 2017-03-16 10:39
帖子: 4
系统: win10
送出感谢: 0 次
接收感谢: 0 次
我在修改之前是能上网的。。
路由器的网关变了,所以修改了ip就是那个网卡的网关地址即使修改了,可是ifconfig看到的还是原来的。。


页首
 用户资料  
 
7 楼 
 文章标题 : Re: 求助,ub下修改ip地址问题
帖子发表于 : 2017-03-16 21:09 

注册: 2007-01-14 16:23
帖子: 4257
送出感谢: 0 次
接收感谢: 107
引用:
iface eth0 inet static
address 192.168.0.16
netmask 255.255.254.0
gateway 192.168.0.1


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 7 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 0 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译