she*_*ard 15 networking linux virtualbox ubuntu
如何为 Virtual Box 中运行的 Ubuntu Server 12.04 来宾操作系统分配固定 IP 地址?
我见过这个问题,但它没有解决使用“桥接适配器”的问题。
虚拟机当前正在获取范围内的 IP 192.168.10.x,我希望它始终是192.168.10.99.
Rai*_*ain 14
当你给一个虚拟机一个桥接适配器时,它实际上就像给它自己的网卡直接连接到你的网络。
VM 内的 Ubuntu 安装需要设置为使用静态 IP 地址。这是在/etc/network/interfaces文件中完成的。interfaces可以在此页面上找到有关该文件的一些信息:https : //help.ubuntu.com/12.04/serverguide/network-configuration.html
这是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
auto eth0
iface eth0 inet static
address 192.168.10.99
netmask 255.255.255.0
broadcast 192.168.10.255
network 192.168.10.0
gateway 192.168.10.1
Run Code Online (Sandbox Code Playgroud)
对 进行修改后/etc/network/interfaces,重新启动 VM 以使更改生效。
| 归档时间: |
|
| 查看次数: |
33275 次 |
| 最近记录: |