zoukankan      html  css  js  c++  java
  • debian网络静态ip配置

    本配置适合于服务器上的静态ip配置,该方法简单可靠。

    1 临时配置

    ifconfig eth0 192.168.1.97 netmask 255.255.255.0 broadcast 192.168.1.255

    ip route add default via 192.168.1.1

    2 主要的网络配置文件

    /etc/network/interfaces

    /etc/resolv.conf

    3 配置ip、netmask和gateway

    在/etc/network/interfaces里面加上:

    auto eth0 (这个是告诉debina,系统启动时启用该接口)

    iface eth0 inet static

        address 192.168.1.19

        netmask 255.255.255.0

        gateway 192.168.1.1

    4 配置dns server

    4.1 第一种方法

    在/etc/resolv.conf中加入:

    nameserver 192.168.1.1

    该配置方法在reboot后resolv.conf中的内容可能会被删掉。

    4.2 第二种方法

    按照resolvconf包。

    在/etc/network/interfaces里面的iface里面加上:

    dns-nameservers 192.168.1.1

    5 配置好之后重启网络服务

    sudo service networking restart

  • 相关阅读:
    分分钟搞定Python之排序与列表
    分分钟搞定Python之排序与列表
    联系我
    联系我
    联系我
    联系表单 1_copy
    联系表单 1_copy
    联系表单 1_copy
    联系表单 1
    联系表单 1
  • 原文地址:https://www.cnblogs.com/hustdc/p/7856639.html
Copyright © 2011-2022 走看看