UBI的ESXI服务器如何设置 附加ip路由

By | September 1, 2016

文章地址:https://www.ubiquityhosting.com/blog/bind-ips-solusvm-citrix-xenserver-vmware-esxi/#VMware

 

VMware ESXi does not include necessary network routing features in its kernel, so we will need to create a CentOS 6.x based guest/virtual machine on the hypervisor to act as our router for the additional IP address assignment.

First, ensure that your installation of VMWare ESXi is not configured with the first usable IP address of your base assignment. Should it be configured with this address, you will need to update it to any other available IP address from the base assignment. The reason for this being that the first usable IP address must be used on the guest/virtual machine we’ll be creating as our router. After you have confirmed the first usable IP address is not in use, you’ll want to create a CentOS 6.x guest/virtual machine on the hypervisor. Once it has been created, login to it and edit its eth0 configuration file:


[root@localhost [~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Paste in the following contents (replacing with your base IP assignment’s first usable address and gateway address):


DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=23.19.75.250
GATEWAY=23.19.75.249
NETMASK=255.255.255.248

Save the file, and then create an alias for it:


[root@localhost [~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0:1

Paste in the following contents (replacing relevant variables with your additional IP assignment information):


DEVICE=eth0:1
IPADDR=172.241.205.2
GATEWAY=23.19.75.249
NETMASK=255.255.255.0
ONBOOT=yes

Again, save the file. All adjustments to our network configuration have been completed, so let’s make the changes we made take effect now:


[root@localhost [~]# /etc/init.d/network restart

Now that our network configuration changes are in effect, we can move onto the next step: the enabling and disabling of some kernel runtime parameters. One parameter, 

net.ipv4.ip_forward

, should already exist in 

/etc/sysctl.conf

 and simply needs to be updated to ‘1’ to enable it. The remaining parameters that need to be appended to the end of the 

/etc/sysctl.conf

 configuration file are the following:


net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.eth0.send_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.eth0:1.send_redirects = 0

So, let’s open up the relevant file and append our parameters to the end of the 

/etc/sysctl.conf

configuration file:


[root@localhost [~]# vi /etc/sysctl.conf

Save the file, and then activate the changes we just made:


[root@localhost [~]# sysctl -p

Lastly, let’s ensure that the iptables firewall is disabled:


[root@localhost [~]# /etc/init.d/iptables stop && chkconfig iptables off

All necessary steps have now been completed. You can now utilize your additional IP assignment by adding its IPs to guest/virtual machines. Just ensure that you set the gateway address to the IP configured on the 

eth0:1

 alias for any new guest/virtual machines that you create with an IP address from this assignment.

Leave a Reply

Your email address will not be published.