美文网首页
centos6.5配置网络及虚拟网卡

centos6.5配置网络及虚拟网卡

作者: codeMan_6616 | 来源:发表于2017-07-28 15:43 被阅读67次

    1.配置网络

    vi /etc/sysconfig/network-scripts/ifcfg-eth0
    

    修改

    DEVICE=eth0
    TYPE=Ethernet
    ONBOOT=yes
    NM_CONTROLLED=yes
    BOOTPROTO=none
    IPADDR=192.168.1.238
    PREFIX=16
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=no
    GATEWAY=192.168.1.1
    

    重启网卡

    /etc/init.d/network restart
    

    2、修改DNS

    修改对应网卡的DNS的配置文件
    vi /etc/resolv.conf
    修改以下内容

    nameserver 8.8.8.8
    nameserver 114.114.114.114
    

    3.设置虚拟ip

    sudo ifconfig eth0:0 192.168.11.236 up
    ifconfig eth0:1 192.168.1.237 netmask 255.255.0.0 up
    

    相关文章

      网友评论

          本文标题:centos6.5配置网络及虚拟网卡

          本文链接:https://www.haomeiwen.com/subject/udqflxtx.html