新手学堂 Linux操作系统下配置静态IP上网

  • 来源: 驱动中国 作者: 李祥敬   2009-12-09/16:06
  • 1 配置网卡

    PCI的可以自动检测到,我就不多说如何加载驱动了,直接说如何配置IP

    vi /etc/sysconfig/network,按照你的情况修改

    DEVICE=eth0<--设备

    ONBOOT=yes<--是否自动启动

    BOOTPROTO=static<--是否使用静态IP

    IPADDR=xxx.xxx.xxx.xx<--你的IP

    NETMASK=255.255.255.224<--你的子网掩码

    GATEWAY=218.99.1.17<--你的网关

    2 配置dns解析

    echo "nameserver 211.98.1.28">> /etc/resolv.conf

    3 启动网络

    /etc/init.d/network restart

    4 测试

    ping www.sina.com.cm

    64 bytes from 202.106.184.200: icmp_seq=0 ttl=249 time=1.881 msec

    64 bytes from 202.106.184.200: icmp_seq=0 ttl=249 time=1.881 msec

    64 bytes from 202.106.184.200: icmp_seq=0 ttl=249 time=1.881 msec

    64 bytes from 202.106.184.200: icmp_seq=0 ttl=249 time=1.881 msec

    ...

    ...

    OK


    评论 {{userinfo.comments}}

    {{money}}

    {{question.question}}

    A {{question.A}}
    B {{question.B}}
    C {{question.C}}
    D {{question.D}}
    提交

    驱动号 更多