Thursday, September 17, 2009

More progress with ESXi

OK. I got the following virtual network configuration working on my ESXi installation here at home. A little Googling resulted in a blog posting entitled "Implement NAT under VMware ESX 3.5 using a Vyatta router" (how's that for finding exactly the "how to" I needed?).

I ended up with a network that looks like:

Virtual Network <-> Vyatta Router <-> VMware NIC <-> Network
  • The Virtual Network has all of my VMs running on 172.16.0.0/24
  • The Vyatta Router routes traffic received on 172.16.0.1 to its other virtual NIC at 192.168.0.3 and applies NAT
  • VMware supplies the networking to take traffic from Vyatta's virtual NIC to the physical NIC at 192.168.0.4
  • My existing Linux router (CentOS 5.3 with IP tables configured to do NAT) does it's thing and routes the traffic, as appropriate, on my network or to the Internet.
As I was setting this up I realized that there isn't any need to run ANY routing protocol on the Vyatta router (same as with my CentOS box that does my normal routing). There is only "choice one of one" routes from the Vyatta router to both my network and the outside world. You only need to run a routing protocol such as OSPF, BGP or RIP if there is a choice of routes.

Vyatta reports my routing information as:

vyatta:~# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - ISIS, B - BGP, > - selected route, * - FIB route

S>* 0.0.0.0/0 [1/0] via 192.168.0.1, eth0
C>* 127.0.0.0/8 is directly connected, lo
C>* 172.16.0.0/24 is directly connected, eth1
C>* 192.168.0.0/24 is directly connected, eth0

The above configuration works just fine from each of the VMs. I am able to browse the Internet, run the specific OS's update protocol, etc. I dumped the "history" to a file. This looks like (time stamps removed):

204 configure
205 set interfaces ethernet eth0 address 192.168.0.4/24
206 set interfaces ethernet eth1 address 172.16.0.1/24
207 set service nat rule 1 source address 172.16.0.0/24
208 set service nat rule 1 outbound-interface eth0
209 set service nat rule 1 type masquerade
210 commit
211 set system gateway-address 192.168.0.1
212 set system host-name vyatta
213 set system domain-name davenjudy.org
214 commit

There was a "save" after the last commit (that doesn't show up in the history) to make things "permanent."

I'm guessing that we could run OSPF instead of setting up the static route to my real gateway (see the "set system gateway" command, above). That seems like creating a lot of overhead for something that will "never" change.

Cheers,
Dave Miller

1 comment:

Followers

About Me

My photo
B.Sc. ('78) and M.Sc. ('80) in Math from Ohio State followed by 12 yrs at TRW and a variety of software development positions since then. Currently living in Colorado and enjoying "trial retirement". For fun I climb mountains in the summer and ski down them in the winter, fix gourmet food and have an excellent wine cellar.