0

I'm getting a /27 of IPv4 addresses assigned to my rack and I want to assign one IP address to each server. I have a HP 2510G switch. Would it be possible to use Centos as a router to assign an IP address to each port on the switch?

I want this so if a client reinstalls, the OS installer will automatically assign the correct IP address to the server. I also don't want clients to be able to assign themselves extra IP addresses without paying.

I apologize if I'm explaining this wrong, I have never done this.

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
Geo
  • 1

2 Answers2

0

Switches don't have IP's on each port. If what you want to do is configure it so that only 1 IP works for each port, you would need a firewall to drop/control that traffic.

Additionally, a DHCP server could be used to ensure that each MAC address could be assigned a static IP to ensure that if the host OS is re-installed, it would receive the same IP back. This doesn't prevent someone from adding extra IP's if they so choose; again, a Firewall would be able to manage this.

And yes, CentOS could do this, but you may want to look into the appropriate network appliances built for this stuff.

Andrew
  • 2,142
  • 2
  • 19
  • 25
0

I'm getting a /27 of IPv4 addresses assigned to my rack and I want to assign one IP address to each server.

This is no problem. If you need to enforce the MAC/IP-port binding in the switch you need to take a look at MAC authentication or similar.

I have a HP 2510G switch. Would it be possible to use Centos as a router

This depends on whether the /27 range is routed to you (you need to supply the default gateway yourself and have an uplink router outside your /27 subnet) or switched (the default gateway is supplied by the ISP). When routed, you could use any router of your own to forward all traffic. When switched, this is a bit harder.

to assign an IP address to each port on the switch?

This can be accomplished by setting up a DHCP server with reservations (e.g. on the router). However, you should make sure that the DHCP (broadcast) domain ends at your uplink interface (the 2510 doesn't support DHCP snooping which would be very handy). This is ensured when the subnet is routed but not when it is switched.

I also don't want clients to be able to assign themselves extra IP addresses without paying.

I don't think this is possible with the 2510. You'd need to take care of that on the router/default gateway.

Zac67
  • 10,320
  • 2
  • 12
  • 32