本文共 2175 字,大约阅读时间需要 7 分钟。
xen vm安装
Hello,
你好,
I have installed Xen4Centos on Centos7, having single NIC card with bridge and have two VMs on that.
我已经在Centos7上安装了Xen4Centos,它具有带有桥接单个NIC卡,并且具有两个VM。
In one VM, I want to add two static IP one for webserver and one for mail server.
在一个VM中,我想为Web服务器添加两个静态IP,为邮件服务器添加一个静态IP。
So I have created IP alias in guest VM, it was created but it was not pinging from outside public network or from the host.
因此,我在来宾VM中创建了IP别名,它是创建的,但不是从外部公共网络或主机ping来的。
So if you have any idea how to add second IP in the guest VM then please let me know.
因此,如果您有任何想法如何在来宾VM中添加第二个IP,请告诉我。
I have searched on but most of the tutorials had given example for one IP only.
我在上进行了搜索,但是大多数教程仅给出了一个IP的示例。
Nishit
尼希特
For bridged network in Xen, it should be good to set 2 IPs on the NIC for the VM.
对于Xen中的桥接网络,最好在VM的NIC上设置2个IP。
In the VM configuration file, first make sure the vif
has no IP specified. A good one is like
在VM配置文件中,首先确保vif
没有指定IP。 好人就像
vif=['bridge=xenbr0']
Inside of the VM, you can configure 2 IPs for one NIC following your VM OS’ instructions.
在VM内部,您可以按照VM OS的说明为一个NIC配置2个IP。
Thank You so much for posting this issue and replying to my comment.
非常感谢您发布此问题并回复我的评论。
Finally, I have figure out the way to listen the second IP from public network.
最后,我找到了从公共网络监听第二个IP的方法。
I have added second interface in the VM configuration file with MAC address, so inside VM it looks like eth0 and eth1.
我在具有MAC地址的VM配置文件中添加了第二个接口,因此在VM内部看起来像eth0和eth1。
Then I have created a routing table for eth1 and added default gateway and rule to eth1 table
[ ip add default via XXX.XX.XXX.112 dev eth1 table eth1 ] [ ip rule add from XXX.XX.XXX.112 table eth1 ]然后,我为eth1创建了一个路由表,并将默认网关和规则添加到eth1表中
[ip 通过XXX.XX.XXX.112添加默认值dev eth1表eth1] [从XXX.XX.XXX.112表eth1添加ip规则]So doing this way second IP in VM was reachable from public network.
因此,这样做可以从公共网络访问VM中的第二个IP。
Great to know you have resolved the problem!
很高兴知道您已经解决了问题!
You method of using an additional interface sounds a nice one too.
您使用其他接口的方法听起来也不错。
For traffic that you would like to route to eth0, you may need to create some specific routing rules.
对于要路由到eth0的流量,可能需要创建一些特定的路由规则。
翻译自:
xen vm安装
转载地址:http://uqowd.baihongyu.com/