Vagrant Host Unreachable - Possible Conflict - networking

I have multiple Vagrant 1.7.4 boxes running on VirtualBox 5, but I believe I am running into conflicts with my network setup. I can always "vagrant ssh" to a box when it comes online, but it's hit or miss if I can access the webserver. Rebooting my machine or starting the boxes in a different order can correct the problem. I am running OSX El Capitan. Here is the relevant setup:
Machine 1 (can't access webserver from OSX):
config.vm.network "private_network", ip: "10.10.10.10"
eth0 Link encap:Ethernet HWaddr 08:00:27:6B:1C:DD
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe6b:1cdd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:775 errors:0 dropped:0 overruns:0 frame:0
TX packets:572 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80340 (78.4 KiB) TX bytes:70508 (68.8 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:3E:44:A3
inet addr:10.10.10.10 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe3e:44a3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:1128 (1.1 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Machine 2 (working fine):
config.vm.network "private_network", ip: "10.11.11.11"
eth0 Link encap:Ethernet HWaddr 08:00:27:6B:1C:DD
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe6b:1cdd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10773 errors:0 dropped:0 overruns:0 frame:0
TX packets:6361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7430638 (7.0 MiB) TX bytes:482303 (470.9 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:73:39:23
inet addr:10.11.11.11 Bcast:10.11.11.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe73:3923/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5646 errors:0 dropped:0 overruns:0 frame:0
TX packets:6693 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:625645 (610.9 KiB) TX bytes:6934485 (6.6 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1270 errors:0 dropped:0 overruns:0 frame:0
TX packets:1270 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1144652 (1.0 MiB) TX bytes:1144652 (1.0 MiB)

Related

What's eth0 used for in docker host machine

I'm using Docker on Windows. When I ssh to a docker host machine(local VM) and type ifconfig, normally we get something like this:
docker#master:~$ ifconfig
docker0 Link encap:Ethernet HWaddr 02:42:82:A3:2D:FB
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr 08:00:27:E8:A3:F6
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fee8:a3f6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:243 errors:0 dropped:0 overruns:0 frame:0
TX packets:235 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39044 (38.1 KiB) TX bytes:39544 (38.6 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:83:CF:41
inet addr:192.168.99.101 Bcast:192.168.99.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe83:cf41/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:297 errors:0 dropped:0 overruns:0 frame:0
TX packets:227 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:29987 (29.2 KiB) TX bytes:32525 (31.7 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:32 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:2752 (2.6 KiB) TX bytes:2752 (2.6 KiB)
I know that docker0 is the bridge network created by Docker, eth1 is the interface connects to the outer world, lo is the loopback interface, my question is what's eth0 here used for?
I think I got the point. When I come to the VirtualBox Network Settings, I found there're 2 network cards, and the first one using NAT with port forwarding.
Name:ssh | Host Port:53289 | Guest Port:22
So I thought the eth0 is used for ssh connection by docker client. That's why there's no such an interface in a normal Linux OS(rather than this Boot2Docker local VM).
Different ideas are welcome!

QTcpServer listening on address 0.0.0.0

I have following code chunk for starting QTcpServer:
void UeConnectionServer::ueStartConnectionServer()
{
QString logText=QString();
if(!this->isListening())
{
if(!this->listen(QHostAddress::Any,
1234))
{
logText=tr("[ERROR]").append(" ")
.append(QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss:zzz"))
.append(" ")
.append(this->errorString());
emit this->ueSignalEventInfoAdded(logText);
}
else
{
logText=tr("[INFO]").append(" ")
.append(QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss:zzz"))
.append(" ")
.append(tr("Server started on address ")
.append(this->serverAddress().toString())
.append(":")
.append(QString::number(this->serverPort())));
emit this->ueSignalEventInfoAdded(logText);
} // if
} // if
} // ueStartConnectionServer
The server is started successfully, however, the following log line shows it is listening on address 0.0.0.0:
[INFO] 25.03.2016 12:02:36:265 Server started on address 0.0.0.0:1234
Why does QTcpServer not gain workstation's IP, for my case 192.168.0.100. I am using Linux and here is ifconfig output:
eth0 Link encap:Ethernet HWaddr 1c:6f:65:92:82:02
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:18984 errors:0 dropped:0 overruns:0 frame:0
TX packets:18984 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3979893 (3.9 MB) TX bytes:3979893 (3.9 MB)
vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01
inet addr:172.16.115.1 Bcast:172.16.115.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:327 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08
inet addr:192.168.77.1 Bcast:192.168.77.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:326 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 6c:fd:b9:2d:cc:90
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6efd:b9ff:fe2d:cc90/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1047445 errors:0 dropped:0 overruns:0 frame:0
TX packets:583455 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1267590187 (1.2 GB) TX bytes:99542638 (99.5 MB)
Is it maybe the problem that QTcpServer tries to get IP address from first network interface in the list and not the active one?
Because the QT documentation says so: QHostAddress
QHostAddress::Any: The IPv4 any-address. Equivalent to
QHostAddress("0.0.0.0").
You don't have to worry, your server listens on all IP addresses it has. You have multiple network interfaces. From all of them you can reach them, if you specify 192.168.0.100 you will limit the server to only 1 network interface.

centos 6.7 - no connection- unknown host

I'm new to centos.
When I'm at work I'm able to connect to my centos server from my mac, Now I'm trying to connect from home and I can't.
I've tried pinging google.com and recieved: unknown host google.com .
Maybe it's something with the ip I get from my home router?
here's my /etc/hosts file:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Here's my ifconfig:
eth0 Link encap:Ethernet HWaddr 00:1C:42:B3:AC:2C
inet6 addr: fe80::21c:42ff:feb3:ac2c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:730172 errors:0 dropped:0 overruns:0 frame:0
TX packets:582258 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:642394306 (612.6 MiB) TX bytes:59636955 (56.8 MiB)
eth1 Link encap:Ethernet HWaddr 00:1C:42:19:FB:DC
inet addr:10.37.129.3 Bcast:10.37.129.255 Mask:255.255.255.0
inet6 addr: fdb2:2c26:f4e4:1:21c:42ff:fe19:fbdc/64 Scope:Global
inet6 addr: fe80::21c:42ff:fe19:fbdc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:694184 errors:0 dropped:0 overruns:0 frame:0
TX packets:465777 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:104085044 (99.2 MiB) TX bytes:1662635867 (1.5 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:3581071 errors:0 dropped:0 overruns:0 frame:0
TX packets:3581071 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3060357993 (2.8 GiB) TX bytes:3060357993 (2.8 GiB)
P.S-
I'm not sure if it matters, but I'm using Nginx server. I can't restart it also.
Please checks your Centos server file
/etc/hosts.allow
It maybe only allowing certain IPs access to the Centos Box
Your work IP maybe in there but your home IP may not

Capturing on a non-default interface with tcpdump

O/P of if config is
[root#test2 ~]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3045306 errors:0 dropped:0 overruns:0 frame:0
TX packets:3045306 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:969363066 (924.4 MiB) TX bytes:969363066 (924.4 MiB)
p4p1 Link encap:Ethernet HWaddr F0:4D:A2:F7:CE:20
inet addr:192.168.250.58 Bcast:192.168.250.255 Mask:255.255.255.0
inet6 addr: fe80::f24d:a2ff:fef7:ce20/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:222163621 errors:0 dropped:0 overruns:0 frame:0
TX packets:29525032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:67504475609 (62.8 GiB) TX bytes:13910424527 (12.9 GiB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:3C:38:60
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
when i executed tcpdump , o/p is
root#test2 ~]# tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on virbr0, link-type EN10MB (Ethernet), capture size 65535 bytes
where it is listening to vibra0 interface as default.
I want to set p4p1 interface as default interface so that i may get appropriate o/p when executing tcpdump.
Any solutions.
You cannot change tcpdump's default interface (unless you hack either tcpdump or libpcap's code).
You can, however, tell tcpdump to capture on a particular interface by using the -i option:
tcpdump -i p4p1

Keystone error with Devstack

I have followed this link to deploy devstack on my virtual machine. When I execute ./stack.sh script in the VM, I get the following error after sometime:
keystone endpoint-create: error: argument --service-id/--service_id: expected one argument
++ failed
++ local r=2
+++ jobs -p
++ kill
++ set +o xtrace
The script terminates without giving any information such as the host on which to access Horizon and the time elapsed in running the script. I am using NAT as my virtual machine network configuration since I am not able to connect to my network using bridge mode.
I get no response when trying to access Horizon from my web browser. When I try to execute stack.sh (not preceded by ./unstack.sh), I get the error that stack is already running. Please note that I am behind a proxy server and this is my network configuration on host and guest machines respectively:
Host Machine:
eth0 Link encap:Ethernet HWaddr d4:be:d9:7f:b3:6f
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:110688 errors:0 dropped:0 overruns:0 frame:0
TX packets:110688 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6738439 (6.7 MB) TX bytes:6738439 (6.7 MB)
vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01
inet addr:172.16.85.1 Bcast:172.16.85.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08
inet addr:172.16.145.1 Bcast:172.16.145.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:602 errors:0 dropped:0 overruns:0 frame:0
TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 60:36:dd:3e:99:e6
inet addr:10.99.19.21 Bcast:10.99.19.255 Mask:255.255.252.0
inet6 addr: fe80::6236:ddff:fe3e:99e6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:215802 errors:0 dropped:0 overruns:0 frame:0
TX packets:222520 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:245659430 (245.6 MB) TX bytes:30196677 (30.1 MB)
Guest Machine (Bridge):
eth0 Link encap:Ethernet HWaddr 00:0c:29:8a:c9:d4
inet addr:172.16.145.128 Bcast:172.16.145.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe8a:c9d4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1965 errors:0 dropped:0 overruns:0 frame:0
TX packets:1508 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2229981 (2.2 MB) TX bytes:160543 (160.5 KB)
Interrupt:19 Base address:0x2024
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:485 errors:0 dropped:0 overruns:0 frame:0
TX packets:485 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:36153 (36.1 KB) TX bytes:36153 (36.1 KB)
virbr0 Link encap:Ethernet HWaddr 2e:32:9b:c3:f4:12
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
My localrc file is configured like this:
FLOATING_RANGE=192.168.1.224/27
FIXED_RANGE=10.11.12.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
ADMIN_PASSWORD=password
MYSQL_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=tokentoken
Please note that I am behind a proxy server. Googling this error returned me some pages that suggest that the issue can be solved by setting the 'no_proxy' variable with the main IP address of the devstack machine.
Links to pages:
https://bugs.launchpad.net/devstack/+bug/1015705
https://answers.launchpad.net/devstack/+question/219539
I don't know where to add these settings or how to solve this whole keystone error. Any help is highly appreciated. Thanks in advance.
You can add your VM IP to the no_proxy variable. In Below snippet, 10.0.2.15 is my devstack VM IP. To be permanently exported when starting your terminal, you can add the below line in /etc/bash.bashrc file.
export no_proxy=localhost,127.0.0.1,10.0.2.15

Resources