RaspberryPi MQTT Broker access via Wifi and Ethernet without interference - raspberry-pi

I would like to run an MQTT broker (Mosquitto) on a Pi2.
The Pi is connected to two networks, ethernet and wifi. Both networks are not administrated by myself.
Two independent DHCP servers in both networks.
How can I make the the broker available in both networks without interference with the network infrastructure.
Dumb question ?
Cheers

By default mosquitto will bind to the 0.0.0.0 address, this is a special address that represents all IP addresses of the host machine. There is no need to run 2 separate brokers, one will work just fine.
This means that the broker will be accessible from both networks. The only problem is that if the pi is getting addresses from DHCP on both interfaces then you will need to know what IP addresses have been assigned in order to access the broker from each network.
I suggest you look up a program called avahi which can be used to provide a mDNS service allowing you to refer to the pi by a .local domain name from both networks.

Related

Communicating with the system under different subnet within a LAN using TCP

I have made two programs using socket programming (TCP), one is for the server and the other is for the client.
They are run on two different machines, and I am successful in communicating between them when they are on the same subnet, but I'm unable to communicate when they are on two different subnets. The machines are on the same LAN in both cases.
What is the solution for communicating between machines on two different subnets?
We have tried to change the subnet address of one of the machines to match with the other, which didn't work. We also tried adding an additional IP address, but are stuck in between.

How to stop icmpv6 neighbor advertisement storm

I have two virtual machines, on each VM, I have two interfaces (enp0s3, enp0s8). Each interface belongs to different subnet.
On each VM I have created an OVS bridge br0, and on br0, I have created a VXLAN port with a remote IP pointing at enp0s3 on the other VM.
The problem is when I connect enp0s8 to br0, I have an icmpv6 neighbor advertisement storm on enp0s3, and when I delete enp0s8 port on br0 the broadcast immediately stops.
How can I stop the icmpv6 neighbor advertisement excessive broadcast? Any insight or troubleshooting tips would be greatly appreciated!
Thanks!
A loop is getting created, one way to overcome this problem is to enable STP protocol which dynamically removes loops from the network:
ovs-vsctl set bridge stp_enable=true

iSCSI multipath settings on CentOS6.5

All,
I want to know is it possible to use only one network card to configure iSCSI multipath for the backend iSCSI storage? E.g, I have a NIC of eth0 with IP address of 192.168.10.100,then I create a virtual NIC of eth0:1 with IP address of 192.168.11.100. The two IPs are corresponding to the ip addresses of the two controllers of the iSCSI storage. Or should one must use two separate physical NICs for iSCSI multipath? I tried the above settings but found only one path is available for any volumes attached to the server. I can ping both IPs of the controllers(192.168.10.10 and 192.168.11.10) without problem.
Cheers,
Doan
To use one network card for multipathing, you need the two NICs on that card to be used, with each one on a different subnet, i.e. using a different switch. It's still not great to have just one NIC card to do this, since that's a single point of failure. For maximum robustness, each path should be independent of the other as much as possible.
So I believe the answer is that it is possible but not recommended.

communicate with dynamic IP raspberry pi sensor node

I want to communicate with Raspberry pi sensor node connected to DHCP network. As node has dynamically allotted ip, I cant directly communicate from with it. How can I do that?
You'll need a zero configuration alternative to deal with returning your changing ip for a given name. On other operating systems the bonjour service deals with this. On raspian you can install avahi:
sudo apt-get install avahi-daemon avahi-browse
This should make your pi available on the network as raspberrypi.local, unless you changed the hostname to something else in the raspian configuration. Avahi browse is optional, but handy to list the names of devices on your network

OpenMq clustering not supported for loopback addresses

If I start up a single instance of the broker on a loopback address I get the following:
[05/Sep/2014:16:45:11 BST] WARNING [B3236]: Bad bind address of portmapper service for cluster, please change imq.portmapper.hostname: Loopback IP address is not allowed in broker address localhost[localhost/127.0.0.1] for cluster
[05/Sep/2014:16:45:11 BST] WARNING [B1137]: Cluster initialization failed. Disabling the cluster service.
I have a setup (actually the Azure Compute Emulator) which allows multiple vms/processes to be started up with their own unique ipaddresses of the form 127.X.X.X which are actually loopback addresses as far as java.net.InetAddress is concenrned. Therefore despite the fact that I am successfully using these addresses for socket to socket communication between those vm/processes I cannot use them to run an OpenMq cluster.
As a work around I have set up the brokers to bind to a SINGLE non loopback address and use different ports and that works. So it's not the case that you can't cluster on one ipaddress.
Why was loopback disallowed?
If it is theoretically possible, is there a setting to enable it for clustering?
According to Amy Kang of Oracle opnenmq users mailing list this is by design since clustering is intended to be across muultiple servers. You can however bind several brokers to one non loopback address and use different ports.