Configure static IP to ovs-bridge and DHCP range to VMs connected to ovs bridge - openvswitch

I'm using openvswitch ovs bridge in my network to connect my 3 VMs to the network, and have the following constraints,
Static IP should be configured to the ovs bridge.
VMs should be in the same subnet as like bridge (but IP should be assigned within the 192.168.1.0/28 subnet).
What is the DHCP configuration to be mentioned for ovs-bridge. The figure depicts the scenario.

Related

Connect Hyper-V VM from WSL (Ubuntu)

I have created a VM on Hyper-V with 2 Network Adapters.
NAT switch for static ip
External Switch (for access internet)
From my command line I was able to connect to the VM with the Nat Switch IP
but from WSL Bash I was not able to connect with IP NatSwitch, but able to connect with ExternalSwitch IP.
Why?
Unfortunately this is the expected behavior. (As of 29/01/2021)
WSL2 uses Hyper-V Virtual Switch, vEthernet (WSL) virtual network adapter, that is providing internal type Hyper-V network that is only accessible from the VM and the Host. The Hyper-V machine has a different virtual network adapter e.g. vEthernet (Default Switch). If that is set to internal that is a different NAT-ed network (subnet) not connected to the WSL one. It is like the Host having 3 NICs and one cable (Cable 1) going to WSL on a subnet that only exists on that adapter/cable and another cable (Cable2) going to Hyper-V guest with a very different subnet on that NIC.
On the other scenario the Hyper-V guest shares the subnet with the Host machine ("Same subnet as the 3rd cable/NIC.") so it is routed back to the VM. See red labels.
There is a workaround in this GitHub issue using port forwarding to Guest VM from WSL.

Proxying a port for Virtualbox NAT is inconvenient - can't I provide the host with an IP instead?

I want to be able to SSH into a VM Guest of Virtualbox where the guests are sharing a NAT Network.
LocalNat Portforwarding (See https://www.pythian.com/blog/test-lab-using-virtualbox-nat-networking/ Set Up Portforwarding) is inconvenient vs. having an IP address on the NAT for the host.
Port forwarding requires me to keep specifying the port, e.g. in scp -P 2222 from-file localhost: and it messes with SSH keys as localhost now has two host identities, my laptop and the VM's ssh-rsa key.
Rather than port-forward, is there not a way of just adding another IP for my Virtualbox host?
Thanks, Martin.
You can set up a host-only network in addition to the NAT network. A host-only network is a local network which can connect to both the host and to individual VMs. The host and the VMs can communicate with each other through it.
Using the virtualbox GUI, go to Virtualbox manager > File > Preferences > Network and set up a host-only network. Enable the DHCP server. You could use these settings:
host adapter address is 192.168.56.1
DHCP server address is 192.168.56.100
Both masks are 255.255.255.0
The server address range is 192.168.56.101-192.168.56.254
This gives you the addresses from ...56.2 through ...56.99 to use as static addresses. You can manually assign them to VM interfaces if you like.
After setting up this network, you should see a virtual interface on your host system with the correct IP address (the one assigned to the adapter).
Now, go to network settings for the VM. Add a new network adapter. Set "attached to" to the "host-only adapter", and the name to the host-only network that you set up earlier.
Start the VM. It should see the host-only adapter in addition to whatever adapters it was using before. If it's a modern operating system, it'll probably query the DHCP server and set up the interface on its own. Alternately, from inside the VM OS, you could manually assign static addresses to these interfaces.
You can assign a host-only adapter to a VM in addition to its existing NAT adapter. In the past I've had a windows VM and an Ubuntu Linux VM set up this way. Both VMs and the host had no trouble communicating with each other as well as the Internet.

How VM Name is resolved over the LAN Network?

I have hosted a VM (Red Hat Linux) named test-vm on my Desktop machine (Windows) with a static IP address but I don't have any DNS entry for this static IP address.
Without having an entry in the client's host file, to my wonder the ping test-vm responds. How is this possible? How test-vm is resolved at other machines on our LAN Network without having a DNS entry for test-vm?
Regards,
Adil Khalil
I guess you are using vmware client in your windows desktop. In this case, the hostname is associated to your vmware virtual DNS. With a ping of broadcast in your network, your vmware virtual DNS is forwarding the ping to your VM Client.

Problems with SCNetworkReachability functions when host has both IPv6 and IPv4 addresses

I have written a network client for iOS which uses the SCNetworkReachabilityCreateWithName() function to initiate monitoring of the availability of the remote hosts. This works beautifully if the remote hosts have only IPv4 addresses or only IPv6 addresses.
A problem arises when the client is on an IPv4 only network and is monitoring a host which has both an IPv4 address and an IPv6 address. The client will monitor the IPv6 address of the remote host and indicate that the host is unavailable even though the IPv4 address is reachable.
I've searched and have been unable to find a way to instruct SCNetworkReachability to default to monitoring the IPv4 address if an IPv6 network is unavailable.
I can work around this by programmatically determining the public IP addresses of the device, manually resolving the hostname, and using the IPv4 address if a non-link local IPv6 address exists, however I'm hoping that someone has a simpler solution.
Since the functions are the same for both iOS and OS X, this problem would affect OS X clients as well.
My specific implementation is the .m and .h files for my BKNetworkReachability class:
https://github.com/bindle/BindleKit/tree/master/BindleKit/controllers

Why I can't use my physical ip to see my website after using NAT in Eucalyptus

I have two real machines.
One is responsible for NAT and IP redirect called NC2 and another is responsible for eucalyptus KVM established 3 virtual machine.
No doubt, the OS of machine which is responsible for eucalyptus is Linux.
The guest OS of virtual machines are Windows XP.
Each virtual machine is a web server which runs Tomcat
NC2 gives an private IP 192.168.0.3 to Linux server.
Linux server gives 3 IPs which are private class B to virtual machines.
For example, one of guest OS gained IP 172.16.1.5
Now I use NC2 to redirect a physical IP x.x.x.x to 172.16.1.5
Here is my problem:
I can use other PC ,outer IP, connect to the website which is established on 172.16.1.5 with IP x.x.x.x, but I can't use machine with IP 172.16.1.5 to connect to it's own website.
I turned off the firewall on 172.16.1.5, and it's able to connect to internet such as yahoo or amazon. But it just can't use x.x.x.x to connect to it's own website.
I tested other guest OS which are gained 172.16.x.x also not able to connect to x.x.x.x.
How can I do to make guest OS connect it's redirected physical address?
It look likes this is caused by a NAT issue called 'hairpin'. Here is the explanation:
Let machine A on a LAN have a private IP address 192.168.0.10.
Let NAT N translate A's private IP to public 77.33.45.67 for the WAN.
Some 'early/old' NATs take for granted that the translated address in only going to be used from the WAN. Therefore, they don't forward packets on the LAN having ip address = 77.33.45.67 and only let in and forward those with this ip address when they come from the WAN.
This problem is solved in more recent NATs which detect these situations and forward packets properly. This problem is sometime encountered in P2P systems.
If you are lucky, your NAT be may be reconfigured to enable usage of translated address on the LAN. If not, then you need a new NAT.