zoukankan      html  css  js  c++  java
  • ubuntu虚拟机启用双网卡IP配置

    首先要登入自己的虚拟机,这里以ubuntu为例。

    配置两块网卡,一块eth0为NAT模式,另一块为eth1仅主机模式

    # 进入网卡配置页面
    vi /etc/network/interfaces
    # 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 eth0
    iface eth0 inet static
            address 192.168.60.202
            netmask 255.255.255.0
            network 192.168.60.0
            broadcast 192.168.60.255
            gateway 192.168.60.2
    auto eth1
    iface eth1 inet static
            address 192.168.15.202
            netmask 255.255.255.0
            network 192.168.15.0
            broadcast 192.168.15.255
         # 此块网卡不配置网关

    然后重启网卡即可

    /etc/init.d/networking restart

    如果ping不通域名

    则需要修改此文件

    vim /etc/resolv.conf

    修改添加一下内容,即可

    search localdomain
    nameserver 8.8.8.8
  • 相关阅读:
    IOC / AOP
    Volatile
    观察者模式
    Gang Of Four的23中设计模式
    适配器模式
    享元模式
    设计模式
    B树和B+树
    Java内存模型(JMM)
    【Java的IO流之文件字符输入输出流 25】
  • 原文地址:https://www.cnblogs.com/jake-jin/p/13097296.html
Copyright © 2011-2022 走看看