zoukankan      html  css  js  c++  java
  • ubuntu-server14.04 网络配置

    一.启动网卡

    ubuntu server 安装后,ifconfig 发现只有一个lo 和一个p1p1 网卡,

    先查看服务器网卡:ifconfig -a ,发现有lo ,p1p1,p2p1,p3p1,p4p1

    要启动其他网卡,可以通过

    ifconfig p2p1 up    #启动p2p1网卡

    二.配置网卡

    如果需要把网卡配置为指定ip的,

    首先

    vi /etc/network/interfaces

    添加网卡p2p1,p3p1,p4p1

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto p1p1
    iface p1p1 inet dhcp
    iface p2p1 inet dhcp
    iface p3p1 inet dhcp
    iface p4p1 inet dhcp
    

      

    示例:
    address 127.127.127.127 
    netmask 255.255.255.0
    gateway 127.127.127.254

    配置:
    ifconfig em1 127.127.127.127 netmask 255.255.255.0
    route add default gw 127.127.127.254 #添加网关

    #重启网卡
    /etc/init.d/networking restart 
    ifconfig em1 down 
    ifconfig em1 up 
    ifconfig #查看 
    service networking restart #不用sudo

    参考:https://blog.csdn.net/lingbofeiyun/article/details/51566799

  • 相关阅读:
    通俗版说委托
    C#读取配置文件的几种方式
    C#异步了解一下
    C#3DES加密了解一下
    说说泛型
    工厂和抽象工厂
    装饰者模式(Decorator pattern)
    观察者模式(Observer pattern)
    策略模式(Stategy Pattern)
    C#读取Appconfig中自定义的节点
  • 原文地址:https://www.cnblogs.com/sea-stream/p/9803421.html
Copyright © 2011-2022 走看看