10

I've setup 2 vm's within my server and I'm trying to setup a 1:1 NAT for them with firewalld on CentOS 7. Currently both vm's are behind a virtual bridge (virbr0, vnet0, vnet1) and I've made copies of the NIC for each IP to be used with them. I would like to set it up like this:

eth0:0 (public IP) -----> vnet0 (internal IP); eth0:1 (public IP) -----> vnet1 (internal IP)

The way I understand it is I'm looking for a 1:1 NAT but I'm not sure how to set it up. I had originally configured everything with a bridge but the hosting provider does not allow for the bridge on the network, the imaginary mac's of the virtual nic's get everything kicked off the network.

I've tried a few things but I'm not super comfortable with firewalld yet.

1
  • So here's what I've done so far, ultimately I'm trying to get these VM's to have public IP's. That's my main concern. I've setup 2 virtual bridges (virbr1, virb2) each of these has it's own VM. And they're setup with nat like this: eth0:0 --> virbr1 --> vnet0; eth0:1 --> virbr2 --> vnet1 Everything makes it out ok, but when I try to ssh into the IP that's assigned to eth0:0 I'm still getting the main server.
    – dstana
    Commented Nov 10, 2016 at 6:56

1 Answer 1

10

NAT is done at the firewall/router level.

Depending on your firewall/router you can setup 1:1 NAT's the only thing to keep in mind is you can only setup one port to one IP.

So if you have 2 web servers one will have to run a different port (other than 80) for the NAT to work.

1
  • Is there a way to just have it so it's interface to interface instead of port forwarding? Or IP to IP?
    – dstana
    Commented Nov 8, 2016 at 20:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .