Cannot respond to ARP requests in OVS system - arp

In my environment I have two Linux hosts, 1 and 2. They try to communicate with one another and 1 has an openvswitch running.
Before adding the OVS bridge, the host 1 and host 2 could communicate successfully. However, after adding br0 (and eth2 as port), ARP requests from 193.168.1.11 to 193.168.1.1 never get a response.
First of all, notice that the br0 of host1 cannot have the same IP as the eth2, as it is required for eth2 to have a "public" ip address that is given by a DHCP server I do not control. For this question, I assumed br0's IP address is 20.0.1.1.
I configured the bridge like this:
$ ovs-vsctl add-br br0
$ ovs-vsctl add-port br0 eth2
and now, packets from 193.168.1.11 arrive at br0 (as seen on tcpdump).
Then, I added the flow entry:
$ ovs-ofctl -O openflow13 br0 priority=1,arp,in_port=eth2,action=output:NORMAL
which did not solve the problem, and then:
$ ovs-ofctl -O openflow13 br0 priority=1,arp,nw_src=193.168.1.0/24,action=output:NORMAL
still no response...
The ARP flow entry is the only one currently installed. How can I make ARP responses work?

Related

Why does my Mosquitto broker fail to start on boot, but works when started manually?

I have a UDOO x86 running Ubuntu 18.04.5 LTS, with Mosquitto v2. This setup has worked as expected until a recent Ubuntu update.
Now, Mosquitto fails to start on boot. In the Mosquitto log file I see that it correctly finds my config file, but then fails with:
Opening ipv4 listen socket on port 1883.
Error: Cannot assign requested address
It then immediately attempts to restart four more times in rapid succession before (apparently) giving up.
Strangely, if I start Mosquitto manually (using sudo systemctl start mosquitto) immediately after boot, the broker starts without error and works properly (both listeners, see below).
My mosquitto.conf:
log_type all
allow_anonymous true
listener 1883 10.11.12.222 # <-- local IP address of my machine
listener 1883 localhost
I've determined that the error is caused by the line with the IP address. If I use only localhost, or if I just use listener 1883 (which I think binds to all adapters?), mosquitto starts and works correctly.
The computer has two network adapters -- an Ethernet adapter statically assigned to 10.11.12.222, and a wireless adapter on a different subnet (using DHCP) connected to the interwebs. I'd like limit my listener to the Ethernet adapter only (and localhost), hence the desire to specify the IP address.
I've tried turning off allow_anonymous and adding a password file -- this doesn't change the behavior.

Odoo POSBOX assign static IP address

I'm trying to assign a static ip address to my odoo posbox installed on a raspberry pi. I tried editing the /etc/dhcpcd.conf file by adding
interface eth0
static ip_address=192.168.0.30/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
Also tried editing the /etc/network/interfaces file as so,
auto eth0
iface eth0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.1
Both solutions worked, but whenever I reboot my pc the dhcpcd assigns a new ip address. Tried to disable this:
update-rc.d -f dhcpd remove
I am also working in POS Box but I had no problem in dynamic IP although you can refer to the following link. It might be useful because this question is already asked in odoo community.
This is odoo community link where this question has been asked.
Apart from that this link may be helpful to you too.
This link is of github document
There is a lot or problems with dynamic IPs with POSBOX.
You have to edit the IMG, for this follow this steps:
https://stefanoprenna.com/blog/2014/09/22/tutorial-how-to-mount-raw-images-img-images-on-linux/
Afterwards, when you have mounted the IMG, edit the /etc/network/interfaces file
auto eth0
iface eth0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.1
Umount the IMG, then burn it as usual, good luck.

Raspberry PI 3, static ip doesn't work

I want to give my Raspberry PI a static ip address. I only use a network cable. I do not use WLAN.
My "/etc/network/interfaces" is set to static, with address, netmas, network, broadcast and gateway specified. After a reboot the address stays the same. In my router giving it a default address is disabled. I also executed "sudo mv /var/lib/dhcp /var/lib/dhcp1" and rebooted again, still no result. Thank you for your reply.
if you are using Jessie then you need to update the dhcpcd.conf file in /etc/
At the bottom add:
interface eth0
static ip_address=<your ip address>/24
static routers=<your router ip>
static domain_name_servers=<your router ip>
save, exit, reboot

Raspberry Pi Client to Mac Server Error

I am trying to make a Raspberry Pi processor communicate with my MacBook Pro using a C program. I have an Ethernet cable connected to both devices and a USB wireless adaptor for Wifi connection. Both the Mac and Pi are connected via the same Wifi network.
The C code establishes the Client-Server connection and this code can be found here:
Server: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/server.c
Client: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/client.c
The guide I am using is here: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html
I placed the server.c file in one of my Mac's folders and the client.c file in a folder within the Raspberry Pi. After compiling both using 'gcc -o client client.c' and likewise server.c, I run the following on the MacBook Pro's Terminal:
./server 51717
Where 51717 is the port number I am using; the server code requires me to specify the port number. The client requires me to pass in my machine's hostname and port number. Therefore, I run the following from the Raspberry Pi's terminal:
./client localhost 51717
When running both ./server and ./client from my MacBook Pro, the program executes just fine. However, the error occurs when executing ./client from the Pi. This yields a: "Connection refused" error. I have tried looking up 'My Hostname' and inputted the value instead of putting 'localhost'. I also placed my IP address over 'localhost' and merely got a 'Connection timed out' error. I am not sure what else to input as my 'hostname' in order to make the connection work.
The issue was in fact that I needed to use the IP Address of the ethernet cable connected to the MacBook Pro. I found that by going to the WiFi button at the top of the screen, clicking 'Open Network Preferences', and then selecting the ethernet tab.

HBase Error - assignment of -ROOT- failure

I've just installed hadoop and hbase from cloudera (3) but when I try to go to http://localhost:60010 it just sits there continually loading.
I can get to the regionserver fine - http://localhost:60030... Looking at the master hbase server logs I can see the following.
Looks like a problem with the root region.
All of this is installed on a ext4 1TB partition running Ubuntu (Natty) 11. No cluster/other boxes).
Any help would be great!
11/05/15 19:58:27 WARN master.AssignmentManager: Failed assignment of -ROOT-,,0.70236052 to serverName=localhost,60020,1305452402149, load=(requests=0, regions=0, usedHeap=24, maxHeap=995), trying to assign elsewhere instead; retry=0
org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to /127.0.0.1:60020 after attempts=1
at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:355)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:957)
at org.apache.hadoop.hbase.master.ServerManager.getServerConnection(ServerManager.java:606)
at org.apache.hadoop.hbase.master.ServerManager.sendRegionOpen(ServerManager.java:541)
at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:901)
at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:730)
at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:710)
at org.apache.hadoop.hbase.master.AssignmentManager$TimeoutMonitor.chore(AssignmentManager.java:1605)
at org.apache.hadoop.hbase.Chore.run(Chore.java:66)
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:408)
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:328)
at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:883)
at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:750)
at org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257)
at $Proxy6.getProtocolVersion(Unknown Source)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:419)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:393)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:444)
at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:349)
... 8 more
11/05/15 19:58:27 WARN master.AssignmentManager: Unable to find a viable location to assign region -ROOT-,,0.70236052
Fixed this issue for anyone else who finds this. Was a problem with the host file (/etc/hosts). Need to remove entries relating to 127.0.1.1 COMPNAME - just put a hash (#) in front of this line and then restart all hadoop and hbase services.
More on the solution here: http://blog.nemccarthy.me/?p=110
As per #Manav:
If you find yourself in a situation wherein you can't edit /etc/hosts, the following >workaround will also work:
in conf/hadoop-env.sh add the following line:
export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true
I'm using Ubuntu 11.10 (Oneiric) and HBase 0.92.1. These steps fixed my issue for my single server install:
Edit the /etc/hosts: change the IP address associated with the hostname so that it uses your LAN IP instead of 127.0.0.1
Open <HBASE_DIR>/conf/hbase-env.sh
edit HBASE_OPTS, append -Djava.net.preferIPv4Stack=true. The line should look like this:
export HBASE_OPTS="-XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true"
Restart HBase
If you find yourself in a situation wherein you can't edit /etc/hosts, the following
workaround will also work:
in conf/hadoop-env.sh add the following line:
export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true
(removed edit, moved as a separate answer)
your hosts file should look like this
#127.0.0.1 localhost
#127.0.1.1 ubuntu.ubuntu-domain ubuntu
192.168.2.100 ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
This file can be found in /etc/hosts
Regards
Shuja
The trick with a subinterface worked for me, but i used the loopback interface rather than eth0 because eth0 is not always available on my machine (external adapter) and i want it managed by NetworkManager (which refuses to manage eth0 if eth0.1 is defined in /etc/network/interfaces on ubuntu 13.04)
Relevant snippet:
auto lo:0
iface lo:0 inet static
address 127.0.1.1
netmask 255.255.255.0
in addition to the regular
auto lo
iface lo inet loopback
of course
Here's another work-around that Works For Me, if you're unwilling to alter /etc/hosts (since Ubuntu put that entry there for a reason).
As this post explains, the core problem is that the loopback interface has multiple IPs bound to it while hbase assumes there will be only one. The resulting mismatch causes the master to think a region server has one IP (127.0.0.1), when it's really listening on another (127.0.1.1, the IP bound to the host's declared FQDN.)
Removing the /etc/hosts entry is one way to restore the one-interface-one-IP assumption. Replacing 127.0.1.1 in /etc/hosts with a "real" permanent IP is another. Finally, another is to create a new interface: drop this in the bottom of /etc/network/interfaces:
# Bind an interface solely for the default host FQDN IP, to fix reverse dns
auto eth0.1
iface eth0.1 inet static
pre-up ip link add eth0.1 name eth0.1 type bridge
address 127.0.1.1
netmask 255.255.255.0
You should then be able to sudo ifup eth0.1 and see it in ifconfig. Restart hbase & you should be good to go.
If you happen to already be using eth0.1 the pick another slot (i.e. eth0.2), it shouldn't matter.
EDIT: #bcolyn's use of lo:0 also works for me, and is superior since loopback will always be available. In that case the pre-up line also appears unnecessary.
In your hosts file to change host address from 127.0.1.1 to 127.0.0.1

Resources