pfSense Support Subscription

Author Topic: Can I use DHCP for a Virtual IP subnet?  (Read 3128 times)

0 Members and 1 Guest are viewing this topic.

Offline stramato

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Can I use DHCP for a Virtual IP subnet?
« on: April 13, 2011, 02:01:55 am »
Hello, simple question:

My LAN's "real" IP is in 192.168.1.0/24

I created a Virtual IP in 192.168.2.0/24

Can I configure its DHCP to serve addresses within the Virtual IP's subnet?

Offline GruensFroeschli

  • Green Frog
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5063
  • No i will not fix your computer!
    • View Profile
    • FFXI related
Re: Can I use DHCP for a Virtual IP subnet?
« Reply #1 on: April 13, 2011, 04:02:56 am »
No.
How would you distinguish requests for the different DHCP servers?

You can do this by using VLANs and a VLAN capable switch.
We do what we must, because we can.
(Except when you PM me to help you directly - DONT: keep your issues in the forum)

Offline stramato

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Re: Can I use DHCP for a Virtual IP subnet?
« Reply #2 on: April 13, 2011, 05:29:37 am »
Thanks Gruens.

There will be only 1 DHCP in the network.

I just don't want the DHCP clients to use the same subnet of the "real" LAN IP of the pfSense box. Not really for security or anything serious. Just for convenience.

Perhaps i'll just use a separate DHCP box?

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14934
    • View Profile
Re: Can I use DHCP for a Virtual IP subnet?
« Reply #3 on: April 13, 2011, 08:44:04 am »
That isn't really possible in that way. If the DHCP clients are in a different subnet than the LAN IP, then they can't reach it for use as a gateway.

I'm not seeing how having two subnets in that way would be convenient, can you explain a little more about what you're hoping to gain with such a configuration?
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline stramato

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Re: Can I use DHCP for a Virtual IP subnet?
« Reply #4 on: April 13, 2011, 09:45:22 am »
hi jimp thanks for the reply.

Does it mean that for example:

pfSense LAN IP: 192.168.1.1
Virtual If: 192.168.100.1

Separate DHCP Server IP: 192.168.100.2
Default Gateway: 192.168.100.1
IP Range: 192.168.100.3 - 192.168.100.253

The DHCP clients will NOT be able to use the gateway?


For my motivation to do this non-best practice setup, there are a bunch of static IP clients/servers in 192.168.1.0/24 and the clients of 192.168.100.0/24 are windows domain members pointing to an IP in that subnet. I know not the ideal setup, but while we're going through the proper design on paper and red-tape (I arrived in here with this weird setup already in place hehe), this would be the least-intrusive way of getting the load-balancer integrated in the operations.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14934
    • View Profile
Re: Can I use DHCP for a Virtual IP subnet?
« Reply #5 on: April 13, 2011, 10:03:46 am »
It depends on what you mean by "virtual if"

If that's an IP alias, it will work but it's exactly the same as using the LAN IP, it buys you nothing.

If you just need more IPs, use a /23 instead of a /24
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline spetnik

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Can I use DHCP for a Virtual IP subnet?
« Reply #6 on: August 16, 2011, 01:38:17 pm »
I know this is an old thread, but what about using DHCP leases? Would it be possible then to receive a virtual IP, if it is assigned in the lease table?

Thanks

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14934
    • View Profile
Re: Can I use DHCP for a Virtual IP subnet?
« Reply #7 on: August 16, 2011, 03:59:56 pm »
No, because there isn't a way to tell a static DHCP lease client to use a different gateway (in our GUI), so they wouldn't have a valid gateway.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!