Debian中配置静态IP

来源:互联网 发布:最新网络捕鱼赌博平台 编辑:程序博客网 时间:2024/05/29 18:04

原文地址:http://blog.csdn.net/shooter556/article/details/919776


默认安装Debian的时候是用dhcp服务的,有时我们需要设置一下静态IP。

一共涉及两个文件的修改

/etc/network/interfaces

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
        address 192.168.2.121
        netmask 255.255.255.0
        gateway 192.168.2.2

IP地址,掩码,gateway什么的,你应该已经知道,或者可以咨询当地网络管理员

/etc/resolv.conf里面设置DNS服务器,在这种情况下应该就是gateway的地址

nameserver 192.168.2.2            #因为我这里网关就是DNS服务器所以是相同的

最后reboot或者#/etc/init.d/networking restart 


0 0
原创粉丝点击