免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2704 | 回复: 2

[网络配置] ubuntu 下修改ip地址的疑惑! [复制链接]

论坛徽章:
0
发表于 2017-03-16 19:39 |显示全部楼层
各位大侠遇到一个奇怪的问题。。。。
修改了系统的ip地址网关dns
ip地址修改过来了,但网关还是之前的没变化,导致无法上网


请看下面红色字体,之前的ip地址是192.168.1.16,GW:192.168.1.1
修改为192.168.0.16,GW:192.168.0.1

配置文件修改没问题,可是ifconfig看到的还是原来的,

root@nuc-1:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup( and ifdown(
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


下面这里的红色的还是之前的

root@nuc-1:~# ifconfig -a

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)

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:~#


论坛徽章:
17
巨蟹座
日期:2014-11-20 23:04:5215-16赛季CBA联赛之北控
日期:2018-08-01 16:08:4015-16赛季CBA联赛之浙江
日期:2017-12-08 11:25:2415-16赛季CBA联赛之四川
日期:2016-11-21 00:16:50操作系统版块每日发帖之星
日期:2016-07-28 06:20:0015-16赛季CBA联赛之吉林
日期:2016-05-25 15:36:04操作系统版块每日发帖之星
日期:2016-02-12 06:20:002015亚冠之西悉尼流浪者
日期:2015-08-28 14:48:322015亚冠之平阳省
日期:2015-08-19 14:54:162015亚冠之武里南联
日期:2015-07-07 10:49:112015亚冠之城南
日期:2015-06-22 10:15:002015亚冠之山东鲁能
日期:2015-06-18 18:03:44
发表于 2017-03-17 15:36 |显示全部楼层
一般你需要重启网卡或服务,或机器来生效

论坛徽章:
0
发表于 2017-06-20 16:50 |显示全部楼层
回复 2# yyu0378
重启没问题,就是无法访问内网192.168.3.xxx这个段的一个机器

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP