Unable to ping from VM to another VM - networking

I have built two VM, and both use the same network configuration which are NAT for the first network adapter, and Host only Ethernet Adapter for the second adapter.
This is my network configuration for both VM :
First VM
eth0 : dhcp
eth1 : 10.0.0.10 255.255.255.0
Second VM
eth0 : dhcp
eth1 : 10.0.0.20 255.255.255.0
How to solve the problem? should i do or reconfigure something?

In VMWare, Host-Only mean VM's can ONLY network with the host, not other vm's. but in Parallel Desktop and VirtualBox it work.
So in a simple way, if you want to block the network between Second VM and Internet, you could choose NAT and set some firewall with iptable on host.
In VMWare website, you should route between Two Host-Only Networks like this link.
There is more information about Host Only Network.

Related

Cannot ping instances of OpenStack machine from external net

I used DevStack(victoria branch) to quick-deploy the OpenStack all-in-one on my Ubuntu-20.04 system. This machine has a public ip address 222.XXX.XXX.XXX on interface eno1, and the DevStack script has automatically added br-ex and virbr0 interfaces on this machine. Here is my config.
#ifconfig
br-ex: inet 172.24.4.1 netmask 255.255.255.0 broadcast 0.0.0.0
eno1: inet 222.XXX.XXX.XXX netmask 255.255.255.128 broadcast 222.XXX.XXX.XXX
virbr0: inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
Now I created an VM instance on image cirros. On my OpenStack dashboard, I created a private network demo-net of type vxlan, and it has a subnet 'demo-subnet', with the CIDR 10.56.1.0/24 and Gateway 10.56.1.1. The DHCP option is on.
Meanwhile, DevStack has already created a public net with CIDR 172.24.4.0/24(bonded to br-ex) and Gateway 172.24.4.1.
There is a router connecting the demo-net and public net.
I allocated a floating IP 172.24.4.124 in the public net's pool to this instance. I can ping this IP on this machine, and vice versa. But the problem is, when I ping 172.24.4.124 on another machine, it fails. I hope to access the VM instance outside the host, so what should I do to fix it?
Any help will be greatly appreciated! Thank you.
By default, Devstack creates an isolated "external" network which it calls public. You can only connect to this network, and all virtual networks that are attached to it, from the Devstack host. You could try to configure port forwarding (iptables command) on the Devstack host, but the real solution is below.
You need to configure Devstack so that it uses your external network 222.XXX.XXX.XXX. The way this is done is documented at https://docs.openstack.org/devstack/latest/networking.html#shared-guest-interface (assuming your Devstack host has a single NIC eno1). In your case, you need to put this in local.conf:
PUBLIC_INTERFACE=eno1
HOST_IP=222.x.x.x
FLOATING_RANGE=222.x.y.z/PREFIX
PUBLIC_NETWORK_GATEWAY=your router, probably 222.something
Q_FLOATING_ALLOCATION_POOL=start=222.a.b.c,end=222.d.e.f
FLOATING_RANGE is the CIDR for the subnet to which eno1 is connected, and PREFIX is the prefix used by eno1. Q_FLOATING_ALLOCATION_POOL is the range of IP addresses in the 222.x.x.x network that you want to use for floating IPs.
You will have to recreate a Devstack (although it might be possible to change the configuration of the current cloud, I would not know how). Before you do that, I would also strongly recommend reinstalling Ubuntu, to ensure no unwanted configurations from your current setup remain.

I can't assign an IP address to vmware VM from DHCP pool

In GNS3, I have configured the DHCP pool on the router R1, and I have a vmware VM (Ubuntu 16.04), another router R2 and VPCs are connected to R1. The R2 and VPC can get their IP address without a problem, however, the vmwareVM can't receive the IP address.
Note that:
the station is configured as host-only
the connect a host virtual adapter to this network is checked
the VMware Workstation DHCP Server is turned OFF
No configuration on my local PC Network Connections (DHCP)
Once I type the command dhclient eth0 to get the IP address from dhcp, it freezes and returns nothing and no IP address is assigned.
I want to know what is the problem that causes that issue and how to solve it.
Thank you.
My mistake was in the configuration of my VMware network adapter (VMnet2) in my network adapter in my host.
so in order to get the IP address from the DHCP router: I did the following steps:
Create a virtual network (VMnet2) in the virtual network editor
of VMware.
I checked the "Host-only" option
I checked the
"connect a host virtual adapter to this network" option
Uncheck the "use local DHCP service to distribute IP address to VMs".
Do not change the default configuration of the VMnet from your
network connexion options.
I hope that will help someone has the same issue as me

NAT'ing on Oracle Virtual Box doesnt works with static host-only IPs

I am facing the below problem on Oracle Virtual Box. Posting it here
in case anyone has faced the similar issue.
I have a 2 node Juno setup on Oracle VBox.
I have configured one of my interfaces as NAT (For internet access,
package downloads etc)
The other interfaces are configured as Host-Only so that I can SSH
into the VM from my Windows machine.
I have assigned static IPs (192.168.56.*) to these host only
interfaces due to OpenStack configuration.
Observation:
When I give a static IP , the NAT interfaces doesn;t gets IP. When i
run dhclient for the NAT interface, it gets 10.0.2.15 as its IP. Even
after that internet doesn't works.
I have edited nameserver in /etc/resolv.conf, even then it doesnt works.
So the question is:
In a VM having 2 interfaces(NAT and host-only), if we give a static IP
to host only interface (192.168.56 series), the internet access doesnt
works on the NAT interface.
It worked after commenting gateway IP in /etc/network/interfaces.
Ref: https://askubuntu.com/questions/446183/how-to-set-up-nat-and-host-only-networking-with-static-ip-address-in-virtualbox
auto eth1
iface eth1 inet static
address 192.168.56.104
netmask 255.255.255.0
#gateway 192.168.56.1
Thanks

Change gateway sequence with network manager

My computer has 2 ethernet ports and 1 wireless port. One of the ethernet ports (eth5) and the wireless port (wlan0) are both configured to connect to a network server, and the other ethernet port (eth4) is configured to connect to a local network switch for communicating with some local devices. The route table of the computer looks like this (as I can not post image yet):
Destination Gateway Genmask Iface
0.0.0.0 141.21.32.1 0.0.0.0 eth5
10.10.10.0 0.0.0.0 255.255.255.0 eth4
141.21.12.0 0.0.0.0 255.255.252.0 wlan0
141.21.32.0 0.0.0.0 255.255.224.0 eth5
169.254.0.0 0.0.0.0 255.255.0.0 eth5
My question is that, how I could change the sequence of the gateways with the network-manager in ubuntu (permanently), so that the gateway of wlan0 will be used before the eth4's. Otherwise when I unplug the cable from eth5, I will lose connection to the network (the gateway of eth4 will be used by default).
I tried editing the /etc/network/interfaces file, but it conflicts with the network-manager, and it can not handle the dynamic events (e.g., when network cable is plugged or unplugged), meaning that its settings are static, while the network-manager can handle these things perfectly, and change the network configurations adaptively, so I would like to find a solution for this problem with network-manager.
The os is ubuntu 13.04 32bit. Thanks for viewing and I will appreciate for any advice!
Problem is solved by checking the option "use this connection only for resources on its network" in the "Routes" page of the IPv4 settings of the configuration interface for the local network (used by eth4) in network-manager.

connecting a host to the internet through an OpenFlow software switch

I have two Ubuntu virtual machines X and Y.
x has Open vSwitch and floodlight running on it and the Y vm acts as a host.
I have a Host-Only adapter and a NAT adapter attached to X vm. and the Y vm has only a Host-Only adapter.
the host only adapters of X and Y vm's are in the same subnet.
now I want to connect the Y vm to the internet through the OVS running on X vm.
is it possible?
if yes, how?
To get internet connectivity to the host machines only through the Open vSwitch,
USING DHCP
1: add the interface connected to internet(say eth0) on the OVS machine to the OVS bridge.
2: change the ip address of eth0 interface to 0 and get a dhcp ip to the bridge interface using dhclient
3: add the interfaces that are connected to the hosts to the OVS bridge
4: get dhcp ip's to the hosts by using dhclient on the host machines
USING custom IP addresses
1: add the interfaces connected to the hosts and the interface connected to the internet to the OVS bridge
2: make the internet interface ip as 0
3: set the bridge ip address to the ip address that was previously assigned to the internet interface
4: make sure you have the host ip addresses in the same network address range as the bridge IP address.
The easiest way to test openflow servces is to use mininet emulator. Here is a tutorial on how to use it.
http://mininet.org/walkthrough/

Resources