Hello peeps. I'm just wondering if it is possible to connect to 2 seperate networks on a raspberry pi. I plan on the wifi having internet access but the ethernet connection being local only. Is there any problem in doing this?
Thanks for any advice.
-
- Posts: 8
- Joined: Tue Dec 13, 2016 1:06 pm
- AdamStanislav
- Posts: 150
- Joined: Sun Mar 10, 2019 2:44 am
- Location: Wisconsin
- Contact: YouTube
Re: Connecting to 2 networls, one ethernet and 1 wifi
Which model of Raspberry Pi?
- default_user8
- Posts: 680
- Joined: Mon Nov 18, 2013 3:11 am
Re: Connecting to 2 networls, one ethernet and 1 wifi
Research iptablesdalekkaan101 wrote: ↑Fri Apr 19, 2019 3:18 pmHello peeps. I'm just wondering if it is possible to connect to 2 seperate networks on a raspberry pi. I plan on the wifi having internet access but the ethernet connection being local only. Is there any problem in doing this?
Thanks for any advice.
Two heads are better than one, unless one's a goat head.
-
- Posts: 8
- Joined: Tue Dec 13, 2016 1:06 pm
Re: Connecting to 2 networls, one ethernet and 1 wifi
Some more information, plus what I have been trying.
I basically need the raspberry pi to be able to connect to the internet via it's wifi. In addition I need to be able to connect to the pi via a local connection that has no internet(does not need it). I have successfully given the wifi a higher priority so the pi can connect to the internet, but while the wifi is turned on I cannot connect to it via ssh from the local connection(ethernet) as soon as I turn off my wifi I am able to ssh into it.
I basically need the raspberry pi to be able to connect to the internet via it's wifi. In addition I need to be able to connect to the pi via a local connection that has no internet(does not need it). I have successfully given the wifi a higher priority so the pi can connect to the internet, but while the wifi is turned on I cannot connect to it via ssh from the local connection(ethernet) as soon as I turn off my wifi I am able to ssh into it.
Re: Connecting to 2 networls, one ethernet and 1 wifi
By default sshd should listen on all interfaces, connecting from either side should be possible.
Are the networks on each interface are actually different, e.g. 192.168.0.0/24 for eth0 and 10.10.10.0/24 for wlan0?
If the same network is defined on both interfaces, Linux routing gets confused. It can work but that is a rather complex setup, the easiest by far is to use networks numbered differently.
Are the networks on each interface are actually different, e.g. 192.168.0.0/24 for eth0 and 10.10.10.0/24 for wlan0?
If the same network is defined on both interfaces, Linux routing gets confused. It can work but that is a rather complex setup, the easiest by far is to use networks numbered differently.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
-
- Posts: 8
- Joined: Tue Dec 13, 2016 1:06 pm
Re: Connecting to 2 networls, one ethernet and 1 wifi
The IP address are different. However the gateway address happens to be the same (both routers are BT), could this be causing the problem?epoch1970 wrote: ↑Fri Apr 19, 2019 8:58 pmBy default sshd should listen on all interfaces, connecting from either side should be possible.
Are the networks on each interface are actually different, e.g. 192.168.0.0/24 for eth0 and 10.10.10.0/24 for wlan0?
If the same network is defined on both interfaces, Linux routing gets confused. It can work but that is a rather complex setup, the easiest by far is to use networks numbered differently.
Re: Connecting to 2 networls, one ethernet and 1 wifi
The networks should be different.
With multiple interfaces on the same network, by default Linux doesn’t specify which interface is used. It can receive a ping on eth0 and send the “pong” response over wlan0, creating sometimes a bit of an issue.
Other systems default to using the interface traffic was received on to reply. Lookup weak/strong network host model for details.
You can coerce Linux into using the strong network host model, but it is complicated and more importantly it is not mainstream so various services might fall on their faces because the connectivity layer doesn’t behave as usual.
The easiest way to make sure traffic is segregated by interface is to specify different networks on each interface.
With multiple interfaces on the same network, by default Linux doesn’t specify which interface is used. It can receive a ping on eth0 and send the “pong” response over wlan0, creating sometimes a bit of an issue.
Other systems default to using the interface traffic was received on to reply. Lookup weak/strong network host model for details.
You can coerce Linux into using the strong network host model, but it is complicated and more importantly it is not mainstream so various services might fall on their faces because the connectivity layer doesn’t behave as usual.
The easiest way to make sure traffic is segregated by interface is to specify different networks on each interface.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
-
- Posts: 8
- Joined: Tue Dec 13, 2016 1:06 pm
Re: Connecting to 2 networls, one ethernet and 1 wifi
Okay so I changed the ip on the local router. I still have the same strange problem.
I can't ssh into the raspberry pi via the local network while the wifi is turned off. However if I turn wifi off I can then ssh into it, even if I then turn the wifi back on....so long as I ssh into the pi with the wifi turned off, I can continue to do so wifi on or off. Until that is, when I reboot the pi
. I really don't get it.
I can't ssh into the raspberry pi via the local network while the wifi is turned off. However if I turn wifi off I can then ssh into it, even if I then turn the wifi back on....so long as I ssh into the pi with the wifi turned off, I can continue to do so wifi on or off. Until that is, when I reboot the pi

Re: Connecting to 2 networls, one ethernet and 1 wifi
Not quite clear to me.
Do you have a network configuration file you can post?
Do you have a network configuration file you can post?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
- Speedwell68
- Posts: 178
- Joined: Sun May 12, 2013 5:21 am
- Location: Cornwall, UK
Re: Connecting to 2 networls, one ethernet and 1 wifi
Which BT routers are you using?dalekkaan101 wrote: ↑Fri Apr 19, 2019 10:17 pmThe IP address are different. However the gateway address happens to be the same (both routers are BT), could this be causing the problem?epoch1970 wrote: ↑Fri Apr 19, 2019 8:58 pmBy default sshd should listen on all interfaces, connecting from either side should be possible.
Are the networks on each interface are actually different, e.g. 192.168.0.0/24 for eth0 and 10.10.10.0/24 for wlan0?
If the same network is defined on both interfaces, Linux routing gets confused. It can work but that is a rather complex setup, the easiest by far is to use networks numbered differently.