当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : interfaces只能是dhcp吗?
帖子发表于 : 2016-07-31 18:59 

注册: 2016-07-08 17:43
帖子: 87
系统: debian8
送出感谢: 12
接收感谢: 0 次
我的上网方式,路由器+pc.
pc里面的网络接口,我第一次写成

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
dns-server 114.114.114.114

发现无法上网,改写成
auto eth0
iface eth0 inet dhcp
netmask 255.255.255.0
dns-server 114.114.114.114

就可以了,请问,在pc接路由器的环境下,只能在pc机上设置为dhcp吗?
请告知理由。


页首
 用户资料  
 
2 楼 
 文章标题 : Re: interfaces只能是dhcp吗?
帖子发表于 : 2016-07-31 19:11 
头像

注册: 2011-03-20 13:12
帖子: 4521
地址: 山东省寿光县
系统: Debian
送出感谢: 105
接收感谢: 997
whaha 写道:
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
dns-server 114.114.114.114
发现无法上网

添加一条网关设置试试


_________________
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户


页首
 用户资料  
 
3 楼 
 文章标题 : Re: interfaces只能是dhcp吗?
帖子发表于 : 2016-07-31 19:15 

注册: 2009-08-04 16:33
帖子: 16892
送出感谢: 21
接收感谢: 1827
引用:
只能在pc机上设置为dhcp吗?

http://manpages.ubuntu.com/manpages/xen ... ces.5.html
METHODS
Both inet and inet6 address family interfaces can use the following methods (However they are not required):

The loopback Method
This method may be used to define the loopback interface.

The static Method
This method may be used to define ethernet interfaces with statically allocated addresses.

The dhcp Method
This method may be used to obtain an address via DHCP.


页首
 用户资料  
 
4 楼 
 文章标题 : Re: interfaces只能是dhcp吗?
帖子发表于 : 2016-08-08 9:27 

注册: 2011-01-02 12:31
帖子: 171
送出感谢: 17
接收感谢: 5
whaha 写道:
我的上网方式,路由器+pc.
pc里面的网络接口,我第一次写成

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
dns-server 114.114.114.114

发现无法上网,改写成
auto eth0
iface eth0 inet dhcp
netmask 255.255.255.0
dns-server 114.114.114.114

就可以了,请问,在pc接路由器的环境下,只能在pc机上设置为dhcp吗?
请告知理由。


你的静态配置里面 gateway 哪去了?


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

当前时区为 UTC + 8 小时


在线用户

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


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

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

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