Author Topic: SNAT multiple virtual IP addresses  (Read 2537 times)

ccarpenter

  • Zen Monk
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
SNAT multiple virtual IP addresses
« on: August 19, 2014, 09:41:15 pm »
What I am trying to accomplish is I want a specific machine on my lan to be seen publicly from a specific IP address. I have a block of 5 addresses from my ISP. In my network interface I have the first IP address configure as the first address in the block and four virtual IP's for the rest. I want this specific computer to be seen as one of these virtual IP addresses. Looks like I need to be using SNAT for this, but I can't seem to figure it out. I did find this on serverfault:
Code: [Select]
http://serverfault.com/questions/608228/how-to-configure-source-nat-private-ip-public-ip-outbound
Once I set this up I get no access to the internet at all from the local pc. Can anyone clear this up who has done this. The documentation seems sparse for SNAT.

ccarpenter

  • Zen Monk
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: SNAT multiple virtual IP addresses
« Reply #1 on: August 19, 2014, 10:42:44 pm »
I still can't seem to get this working. I need outbound traffic from this pc to be seen as one of the virtual IP addresses on eth1.

ccarpenter

  • Zen Monk
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: SNAT multiple virtual IP addresses
« Reply #2 on: August 19, 2014, 11:00:31 pm »
Strangely looking at
Code: [Select]
sudo iptables -L
shouldn't my rule that I set up under Firewall > SNAT be in here?

ccarpenter

  • Zen Monk
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: SNAT multiple virtual IP addresses
« Reply #3 on: August 20, 2014, 03:17:36 pm »
For anyone that may be in the same position as me. I got this working. Not sure why it didn't work the first time, but after a reboot and readding the rules for SNAT it is working perfectly now.

jbahillo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1444
  • Karma: +77/-2
    • View Profile
Re: SNAT multiple virtual IP addresses
« Reply #4 on: August 20, 2014, 04:04:40 pm »
Hello:

If your question has been solved please stamp [SOLVED] at the thread title. Just for people who watch this thread, to check SNAT rules you need to look at nat table (iptables -t nat -L)