How to route traffic out through ethernet and WiFi on the same subnet?

I am a college student without a lot of money so I am turning one of my Raspberry Pis into a router.

I followed these instructions in general to create a Raspberry Pi that plugs directly into my modem and creates a WiFi network.

https://medium.com/@edoardo849/turn-a-raspberrypi-3-into-a-wifi-router-hotspot-41b03500080e

Some other things I did were to install Fail2Ban and other basic security things when I first launched the Pi.

I have some devices that will need to connect by Ethernet. I have a USB to Ethernet adapter and a Ethernet Switch. I was hoping to have the internet sent through the USB to Ethernet adapter (ETH 0) to my Switch, that can plug into devices that need a wired connection.

I need the internet that goes out of the eth1 device and out of the wlan0 device to be on the same subnet. How do I set this up where they are both on the same subnet?
burnedfacelessAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ajay ChananaMCSE-2003/08|RHCSA| VCP5/6 |vExpert2018Commented:
If your ethernet and wireless is provided by same device then  why you think it will give different network ?

It should provide the same ip range.
burnedfacelessAuthor Commented:
In order to route traffic through the eth1 port on the Raspebrry Pi I believe I need to enter the IP Address I assign to it under option-routers in /etc/dhcp/dhcpd.conf.

When I did this it said they needed to be on different subnets.
nociSoftware EngineerCommented:
So what you need to do is to Bridge the eth0 & eth1   into br0 and then run DHCP & the Ip address of the pi on the Bridge.
see man brctl   for more info on this.

Also verify the "vlan_bridge=..." setting in the hostapd.conf file.
Owen RubinConsultantCommented:
I'm still confused. What exactly do you want to route from and to? If the Raspberry PI is acting as a router, that would imply  two separate networks. Are you trying to separate WiFi and Ethernet into two networks? They don't have to be on separate networks. So can you explain a bit more in what you are trying to do from a network level? Thanks.
Fred MarshallPrincipalCommented:
In the paper you followed, it appears that the internet-side address is in 192.168.2.0/24 and the LAN side is in 192.168.48.0/24.  And, I believe this uses an Ethernet port to the modem, right?

Also, it has 192.168.48.0/24 which is the LAN supporting the original intended WiFi.
You want Ethernet on the LAN as well.
So you added a USB to Ethernet adapter for the LAN side.

So, yes, the two Ethernet interfaces have to be on separate networks.  One for the WAN/Internet and one for the LAN.
WLAN in this case appears to mean Wireless LAN and is using the same subnet as your intended Ethernet LAN devices.

You may have to bridge the WiFi LAN to the added USB Ethernet .. but certainly not the two Ethernet ports!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.