0

I don't know exactly how a SDN implementation would help my situation, but maybe somebody can clarify:

I have physical hosts A and B. Host A has 5 ipv4 addresses routed to it and host B has one.

I want to forward traffic on 4 ipv4 addresses to host B transparently.

Let's say host B is a virtualbox hypervisor. I want 4 virtual machines up on host B that "think" they're on host A's network and have no reason not to.

From what I've seen people manage virtual switches to connect remote sites together via the internet but I want the vms on host B to have host A's publicly routable ipv4 addresses. Is that doable ?

1 Answer 1

0

You'll first need to have a physical connection between host A and B, i.e. both having an interface in the same layer-2 domain (e.g. same VLAN). You can use the interfaces that have the current public IP addresses, if they share the same L2 domain (I think they probably do as per your description)

Your ISP will route any traffic coming from Internet and directed to those IP addresses through host A, so host A has to route them to B. Enable IP forwarding on A, so when A gets the packet destined for any of the other 4 IPs, it will look for the destination in the local-link subnet (ARP resolution) and deliver it.

If A and B share a physical connection and the VMs in B are bridged to that interface, you can configure the IP addresses on the VMs and use A as your default gateway. The VM in host B will receive the traffic from A and return it to A too. As A is probably a stateless forwarder, you can change the VMs' default route to point to the egress router that A uses in the same subnet, so you optimize a bit the performance.

Edited to add: If your ISP router is not specifically routing those IPs down, then you might want to use proxy ARP to capture the requests and route them internally. However, without really knowing all the details it's hard to say what's the best approach in your case and why and how those IP addresses are "assigned" to host A. Maybe you just need to configure them on B and remove them from A? :)

I wouldn't recommend the above though :) You're increasing the points of failure for B (if A goes down, VMs in B go down too)

My recommendation is to talk to your ISP or whoever manages the router upstream and ask them to point the IP addresses to B.

If the requirement to use the public IP addresses is just cosmetic, then use some overlay networking provider that lets you use any addressing in the overlay network. This way you won't be able to route from Internet to those IP addresses though.

2
  • Hey thanks for replying, however, the situation is that there is no L2 link between the hosts. I was looking for a pure software solution no matter the overhead. I was thinking putting both hosts in a virtual switch over ip (if such a thing even exists) and use iptables on host A to direct all packets from those ips to a virtual interface connected in the virtual switch shared by both hosts and do the same thing on the B host - create a virtual bridge interface and connect it to the virtual switch so that the vms would make use of the actual public ipv4 addresses
    – Horatiu
    Feb 1, 2017 at 19:18
  • Ah, got it. Yeah, what I mention in my comment about an overlay network is where you want to go really (and do the routing on that network). You will have a virtual interface on that network, effectively establishing a L2 between A and B (over an L3 connection over the Internet maybe?). There are a few options out there to do this, look at things like Pertino, ZeroTier, Wormhole Network, etc Feb 1, 2017 at 22:23

You must log in to answer this question.

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