Multiple IP addresses

I have my RPi configured with dual IP (ethernet and wireless) but I want Volumio to listen to only one of them as I have another service running on the other IP. I rather have them both on port 80.

I couldn’t any config file that specifies which IP to be used. Is there a way to achieve this?

You might be better searching on the Raspbian forums. It’s a bit of a niche question, and you would reach/search a much bigger audience there. Please post back though if you find the solution :slight_smile:

Two words of warning here though, Volumio is still using ‘Jessie’ rather than the newer ‘stretch’, and there are lots of posting about setting up networks using the ‘/etc/network/interfaces’ file; the latter is deprecated and should be avoided if possible.

this is a Volumio specific problem. The RPi is setup properly, it has 2 fully configured IPs.
Problem is that Volumio listens on both IP on port 80 and I need one of them for another app.
So the question is how to set Volumio to listen on 192.168.0.11 (let’s say) instead of 0.0.0.0 (which means ALL )

I’m not convinced it is Volumio specific. Have a look at the metric parameter for example.

sorry, not sure what you mean by that … " metric parameter" ?

routing metrics … raspberrypi.org/forums/view … p?t=189582, for example

found solution.
it’s ok if Volumio listens on all the interfaces as it listens to port 3000 which does not conflict to my other app.

But to solve my problem, there’s the iptables service that needs to be reconfigured.

ExecStart=/sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000

becomes

ExecStart=/sbin/iptables -t nat -I PREROUTING -p tcp -d 192.168.0.61 --dport 80 -j REDIRECT --to-ports 3000

and that frees port 80 on my other IP. Done.

eventually completely removed the iptables service and added a haproxy in front that does the routing.

Glad you’re sorted :slight_smile:, might be useful to share on here (for completeness of the thread) why iptables wasn’t an acceptible solution.

to be honest it was. but I prefer haproxy. it is more flexible and provides future expansion (eg allows more apps to run on different ports while it acts like a semaphore on port 80)