Devstack networking/can't ping instances - openstack

I am facing a problem how to set up network correctly while using ubuntu 17.10 in virtualbox. I have problem with pinging my instances from host PC and even from guest VM. Same problem in instances, they can't ping VMs or host pc. In virtualbox I am using 3 network adapters (NAT for internet access, 2x host only network paravirtualized [one for communication between nodes another one was meant to be public interface for instances]).
/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# VirtualBox NAT -- for Internet access to VM
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 172.18.161.6
netmask 255.255.255.0
auto enp0s9
iface enp0s9 inet manual
up ip link set dev $iface up
down ip link set dev $iface down
And devstack local.conf was from this page (tried all of them):
https://docs.openstack.org/devstack/latest/guides/neutron.html

I don't know what your configuration files looks like, but for sure, I can suggest for these kinda issues, try to debug step by step.
1: From instance, ping default GW, i.e. virtual router connecting internal network with the external network. If success, go to step 2. If fail, you got your culprit.
2: from the virtual router, ping host endpoint. If successful, try the other way round. If fail, you got your culprit.
If everything works fine, check configuration files, default gw, routing rules etc ...
Do let me, if it works or not !!

After to successfully install Devstack, if you want to grant access from and to instances, you need configure a bunch of settings:
In Security Groups add ingress rules to ICMP, SSH, HTTP, HTTPS, etc;
In the private Network, edit private-subnet to add a DNS Name Servers (8.8.8.8, 1.1.1.1, etc);
Allocated some Floating IP's;
Launch some instances;
Associate a floating IP to each instance;
Set the proxy_arp and iptables (in the host Devstack).
Try to follow this:
How to expose the Devstack floating ip to the external world?

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.

Raspberry PI multiple LAN netoworks

I'm trying to connect my Raspberry Pi 3 model B to two different LAN networks at the same time. One is connected directly to the raspberry and otherr is connected to usb-ethernet adapter.
Both work by them selves correctly, I can acces e.g google through both of them. But when I attach both of them I cannot access the network connected to the adapter.
I found some instructions online on how to connect to two wifi networks, but these didnt really help.
In my network config file I have
auto eth0
iface eth0 inet manual
auto eth1
iface eth1 inet manual
Is there some setting to allow connection through both of them at the same time?
I need the secondary network(through adapter) only for pinging this network. The other is used to ping other network and for other things.
EDIT:
To clarify the situation, I dont need internet access through either of them, but I do need to have access to two separate local networks. Both netwroks run with static IP addresses.
All I had to do was remove the default gateway for the other network. Because having two default networks caused the default gateway to be set as the default gateway of eth1.

debian networking sets wrong ip

I'm currently trying to automate our beaglebone flashing - therefore we have to manually change the ip address.
I created a script which basically adds sth. like:
# The primary network interface
auto eth0
iface eth0 inet static
address theip
netmask 255.255.255.0
gateway gateway
to /etc/network/interfaces
After adding this I restart networking via:
service networking restart
Which returns "ok", but ifconfig doesn't return "theip" it seems like it just ignores the changes and still uses dhcp.
When rebooting the system, the ip is changed and everything works as expected, but I don't want to restart the system. So how do I correctly restart the networking?
Thanks in advance,
Lukas
Do ip addr flush dev eth0 first and then restart the networking service.
Explanation
The /etc/network/interfaces file is used by the ifupdown system. This is different than the graphical NetworkManager system that manages the network by default.
When you add lines to control eth0 in the /etc/network/interfaces file, most graphical network managers assume you are now using the ifupdown service for that interface and drops the option to manage it.
The ifupdown system is less complicated and less sophisticated. Since eth0 is new to the ifupdown system, it assumes that it is unconfigured and tries to "add" the specified address using the ip command. Since the interface already has an ip address assigned by dhclient for that network, I suspect it is erroring out. You then need to put the interface in a known state for ifupdown to be able to start managing it. That is without an address assigned to the interface via the ip command.

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

Configuring multiple IPs for amazon EC2

I need a separate ip addresses for my two sites, so I'm manually configuring Amazon Web services to have 2 public ips with an instance. I've set up 2 elastic ips that are pointed to 2 private ips and they are all under a single network interface.
What manual changes do I need to make to OS (Debian 7) to make the secondary elastic (public) ip to work?
This is what /etc/network/interfaces looks like right now:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
P.S. There does not seem to be a ec2-net-utils package for debian, so I'm doing it manually, thus also learning how networking works.
As per my knowledge, You cannot setup multiple IP in amazon Ec2. You need to assign the IP to each instance and normal EC2 will allow only one IP per instance.
And you can configure two website with one public IP and it will not create any performance issue. If you are particular about two public IP, you can check with VPC in amazon WS

Resources