I am doing some development on a raspberry pi, running arch linux on both the pi and my desktop. After having horrible connection problems with using just wireless (I live in an apartment complex which provides the internet through wireless), I connected the two through a wired router I had lying around, intending to still use the wireless for the internet connection and the wired just as a “private” network between the pi and the desktop.
The problem is as follows:
It appears that the wired connection takes precedence on both computers for internet (makes sense…same flavor of linux). Once plugging in the wired connection to both the pi and my desktop, I was still able to talk over the wireless network (ssh to the pi using its wireless ip from the desktop), but both computers started to try using the wired interface as their internet connection. The wired doesn’t have internet access, so this obviously causes some problems. I would like to either set the wireless network to be the default “internet” connection, leaving the wired as a “private” network, or somehow merge the connections so that whichever has access to the internet is the one used for internet lookups. What is the general procedure for doing this?
I don’t even know how to google this question properly and I have never done something like this. I have been using linux exclusively on my computers for about 3 years now, with about a year on arch linux. My rackspace server that I rent seems to do something like this, but it comes pre-configured that way and I never bothered to really delve into the reasons why it worked that way (in fact, while I am adept at fixing many problems that crop up during linux usage (drivers, package conflicts, etc), I am still quite ignorant of the network configuration options).
Thanks in advance.
If the computers are trying to use the wired interface for all traffic, it means they were configured for that – something added a default route over eth0. You said in a comment that they both get IP addresses from DHCP, so it’s also DHCP that sets up all routes.
It would be best to configure the router to not offer the incorrect routes over DHCP. If it doesn’t let you do that, then set up DHCP clients to reject those routes – in
dhcpcd.conf it would probably be:
I am not sure specifically with Arch, but the following should work with many Linux distros:
In /etc/sysconfig/network (or whatever the network config file is for Arch) add the line:
Or whatever your wireless interface is. This will fork any non-local traffic over the wireless interface.