The pfSense Store

Author Topic: NAT same subnets  (Read 1259 times)

0 Members and 1 Guest are viewing this topic.

Offline GMontag

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
NAT same subnets
« on: May 18, 2012, 04:29:12 pm »
I'm trying to setup a somewhat unusual setup, and I'm not sure if it is even possible. I was hoping someone could give me some tips or topics to search for to point me in the right direction.

I have a production network on 10.x.x.x and I want to setup a mirror of this network on an ESXi box for testing purposes. If possible, I'd like to set it up so that the testing network has the same IPs as the production network. Accordingly, I was hoping it would be possible to set up a pfSense VM as the gateway to the private network in the ESXi box doing NAT such that the production network sees the testing network at 10.128+x.x.x and vice versa. I.e. if I have boxes on my production network at 10.2.3.4 and 10.5.6.7, I want to be able to ping 10.130.3.4 from 10.5.6.7, have it routed to the pfSense VM, which NATs the destination to 10.2.3.4 and the source to 10.133.6.7 and the passes it on into the private network contained in the ESXi box, and vice versa from pinging from inside the test network.

Is this doable with pfSense? If so, how?

Offline Efonne

  • Hero Member
  • *****
  • Posts: 630
  • Karma: +0/-0
    • View Profile
Re: NAT same subnets
« Reply #1 on: May 19, 2012, 12:03:59 pm »
To do what you want, I think you will either need two pfSense VMs connected in series to handle the double NAT necessary or on your production network's gateway either setting up another subnet, some outbound NAT, or 1:1 NAT.

Offline cmb

  • Administrator
  • Hero Member
  • *****
  • Posts: 6333
  • Karma: +0/-0
    • LinkedIn
    • Twitter
    • View Profile
    • Chris Buechler
Re: NAT same subnets
« Reply #2 on: May 20, 2012, 03:40:27 pm »
What Efonne said. The box that's connected to the real 10.x.x.x network can't be the same box connected to the test 10.x.x.x network (can't have the same network on diff NICs of any router/firewall). Just put one box between those two and you're good, you can 1:1 NAT the subnet as needed. Though I'd recommend extreme caution, without knowing a lot more about the network than any of us possibly could it's hard to say what ramifications are possible there, but make sure nothing can leak from test to production to break things. It's commonly preferable to have them 100% isolated for that reason, though that's not always practical or possible.

Offline GMontag

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: NAT same subnets
« Reply #3 on: May 22, 2012, 03:07:37 pm »
OK, I ordered the pfSense book, but it appears to be backordered on amazon, so I guess I'll ask a few more questions. I'm a bit confused about having 2 routers in series. Do I have it go prod network <-> (10.0/9 / 10.128/9) <-> (10.128/9 / 10.0/9) <-> test network? I'm having a hard time picturing how that would work.