1

There are a great many tutorials to do this that require setting up my Pi as a DHCP server. This puts downstream devices on a new subnet.

Use case: I want my Pi, which is connected via my WiFi, to allow my Ethernet only network HiFi Amp, to share the internet connection. It needs to be on the main subnet so I can see it on the network. For example, I want to be able to use my mobile app to control my HiFi amp, and I want Spotify Connect on my amp to appear as a playable client from my phone.

How can I share internet from my Pi WiFi out my Pi Ethernet port but have my HiFi amp (connected to my Pi Ethernet)receive an IP from the same subnet on my home lan, so that it can be accessed from any other device on the LAN?

Updates from comments:
My Home router 192.168.0.1 is a DHCP server. I don't want my Pi to give Ethernet devices a 192.168.n.x address. I want to just share the internet connection, and whatever is plugged to the Ethernet port (in my case my HiFi Amp) to get an address on the home LAN's subnet... 192.168.0.n. Otherwise the HiFi amp doesn't seem accessible from the network for the two examples I provided. e.g. if it gets an address from the Pi such as 192.168.2.56 the device isn't seen by my phone, for example, which is on the main subnet.

Also I'm not trying to set up a WiFi access point. I'm trying to turn my Pi into an Ethernet router, with a bridged WiFi connection. I know I don't want two DHCP servers. That's the point of the question.

square_eyes
  • 121
  • 1
  • 6
  • 1
    It is unclear from your question exactly what you are trying to achieve. While it is true that most Access Point tutorials also describe how to setup a DHCP server, but there is no reason why you couldn't use an existing DHCP server (it is generally not possible - or desirable, to have more than 1 server, although you could serve a limited subset of the IP range). – Milliways Apr 18 '19 at 08:10
  • I have a use case. It tried my best to explain exactly what I want to achieve. My Home router 192.168.0.1 is a DHCP server. I don't want my Pi to give Ethernet devices a 192.168.n.x address. I want to just share the internet connection, and whatever is plugged to the Ethernet port (in my case my HiFi Amp) to get an address on the home LAN's subnet... 192.168.0.n. Otherwise the HiFi amp doesn't seem accessible from the network for the two examples I provided. e.g. if it gets an address from the Pi such as 192.168.2.56 the device isn't seen by my phone, for example, which is on the main subnet. – square_eyes Apr 18 '19 at 08:17
  • Also I'm not tryiing to set up a WiFi access point. I'm trying to turn my Pi into an Ethernet router, with a bridged WiFi connection. I know I don't want two DHCP servers. That's the point of the question. – square_eyes Apr 18 '19 at 08:22
  • 1
    It is not possible to bridge a WiFi client connection (**wlan0**) with a wired interface (**eth0**). You have to use workarounds. I have some, but only tested with Raspbian Stretch. I don't believe that's also working with outdated Raspbian Jessie. – Ingo Apr 18 '19 at 10:24
  • How about these? https://github.com/arpitjindal97/raspbian-recipes – square_eyes Apr 19 '19 at 00:20
  • Also I have a good reason to be on Jessie as it is also a Bluetooth audio receiver, and I spent weeks trying to get Stretch to play ball, but general consensus at the time was that it wasn't possible. I could only get the tutorial to work on Jessie. The Pie is set up and working perfectly as a headless (lite) Kodi media centre, bluetooth receiver and the final step is to share internet with my AMP. https://github.com/BaReinhard/Super-Simple-Raspberry-Pi-Audio-Receiver-Install – square_eyes Apr 19 '19 at 00:26
  • Finally, this is the third or fourth attempt at providing internet out my ethernet port. At the time I had tried Stretch and word was it only worked on Jessie. I can't find that link right now but suffice to say I have battled this for a while and settled on Jessie for a reason. – square_eyes Apr 19 '19 at 00:29

1 Answers1

0

On a Raspberry Pi it is not possible to bridge a WiFi client connection. This is due to limitations of the on-board WiFi device. For further information you can look at Raspberry Pi WiFi to Ethernet Bridge for a server?. You explicitly excluded to use routing with different subnets.

So you have to use a workaround to emulate a bridge. You can use proxy-arp to build a pseudo bridge that does not work on the data link layer (OSI layer 2) like a real bridge. It only works on the network layer (OSI layer 3) so you have to use some helpers and need a bit more effort to set it up. Here I have presented two solutions Workaround for a wifi bridge on a Raspberry Pi with proxy arp. Because you have a fixed setup (no components are moved) I suggest to use section Static configuration of proxy arp.

Ingo
  • 40,606
  • 15
  • 76
  • 189