![]() ![]() Get-NSXEdge -name My-NSX-Edge-Name | Get-NSXEdgeNat | New-NSXEdgeNatRule -Vnic 0 -OriginalAddress 10.10.10.15 -TranslatedAddress 192.168.1.5 -action dnat -Protocol tcp -Enabled -OriginalPort 20005 -TranslatedPort 22 Where 10.10.10.15 is the public interface of the NSX Edge, 30004 is the port you want to forward to port 3389 on 192.168.1.4 behind the edge Get-NSXEdge -name My-NSX-Edge-Name | Get-NSXEdgeNat | New-NSXEdgeNatRule -Vnic 0 -OriginalAddress 10.10.10.15 -TranslatedAddress 192.168.1.4 -action dnat -Protocol tcp -Enabled -OriginalPort 30004 -TranslatedPort 3389 DNAT Rulesĭefinitely one you want to script…especially if you have lots of VMs or hosts that you want to connect to.Īssuming you are still connected to NSX manager, issue commands like the following for RDP: You should now be able to reach the internet from those private networks….assuming they are using the correct interface on the NSX Edge as their default gateways. Where 10.10.10.15 is the routable IP address on the Uplink interface of the Edge and the My-NSX-Edge-Name is whatever you called the Edge itself Get-NSXEdge -name My-NSX-Edge-Name | Get-NSXEdgeNat | New-NSXEdgeNatRule -Vnic 0 -OriginalAddress any -TranslatedAddress 10.10.10.15 -action snat -Enabled Who knows when you will want to automate or repeat it right? For me, never do it via the UI when you can script it. Only one of these, so PowerShell or UI….your choice. ![]() Replace the IP and the credential bits appropriately. So open an PowerCLI window and issue the followingĬonnect-NsxServer -NsxServer 10.10.10.5 -Username nsx-administrator -Password nsx-password -VIUserName vcenter-administrator -VIPassword vcenter-password CONNECT TO NSX MANAGERīefore you issue the commands get connected to the NSX Manager. You need PowerCLI and PowerNSX installed to achieve. Once you have the NSX Edge setup with the relevant interfaces and addresses configured on it, here’s a couple of powershell commands that will get you up and running. Lo and behold, one RDP/SSH window, more real estate for the connection on your screen and little less likely to go mad. Closest I’ll get to a claim to fame (or to Batman for that matter) □Ī nice trick to overcome the spiralling console windows (there’s no fix for my desire to be Batman) is to put an NSX edge and SNAT rule in place to allow those private networks to reach the outside world and then use DNAT rules to port-forward to your individual machines. Apart from the squinty look, thats the back of Cillian Murphy’s head. Incidentally that image fits on multiple levels for me. ![]()
0 Comments
Leave a Reply. |