博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
xen vm安装_如何为Xen VM添加两个静态IP?
阅读量:2514 次
发布时间:2019-05-11

本文共 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。

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。


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/

你可能感兴趣的文章
O/R Mapping实际开发经验之谈(转)
查看>>
今天才知道原来我还没弄清楚js中全局变量和局部变量的定义...
查看>>
用户心理特征
查看>>
【z05】聪明的质检员
查看>>
【5001】n皇后问题
查看>>
【codeforces 796D】Police Stations
查看>>
数据库事务与锁详解
查看>>
linux 配置ssh免密码登录
查看>>
《重构》的读后感
查看>>
MySQL索引分析和优化
查看>>
DB2中通用的存储进程分页法度典范
查看>>
Fetchmail 6.3.8
查看>>
俄罗斯邮政将迁移到Linux 有关机构已末尾测试Linux
查看>>
SunOS 4上MySQL详尽事变
查看>>
python升级后pip 不可用 卸载pip
查看>>
推送kafka消息失败
查看>>
Nginx日志增长过快详细分析
查看>>
View Controller Programming Guid for iOS 笔记
查看>>
[模板] 最大流和费用流分别的两种做法
查看>>
python 最大连续子数组的和
查看>>