Set up ethernet connection to one router while connected wirelessly to another

2

This is probably a very simple problem but I have little/no networking experience. I have a wireless internet connection that I want to keep as my default gateway for internet access, I want to be able to plug in another router via the ethernet port so that I can ssh it, but keep my wireless connection as the main internet connection.

When I'm connected to the internet wirelessly my computer is assigned the IP address 192.168.0.5 and the wireless router's IP address is 192.168.0.1.

If I plug into the ethernet router, it tries to assign me an IP address in the range 192.168.0/8 and its IP address is 192.168.0.10.

I am using Mac OSX 10.8. Is it possible to configure a setup whereby I maintain connection to the internet wirelessly and connect to the other router via ethernet?

James

Posted 2013-11-08T13:59:45.640

Reputation: 153

Didn't you mean range 192.168.0/24 eg. 255.255.255.0? – week – 2013-11-08T14:21:03.343

yeah sorry, I think that's what I meant, as I say, I'm not that experienced with networking stuff – James – 2013-11-08T14:31:01.673

Answers

2

The routers would need to be configured in different network subnets. When they are in the same subnet, the TCP/IP protocol stack on your computer cannot distinguish between them (addresses 192.168.0.5 and 192.168.0.10 are local to both wired and wireless connection - the computer does not know with which interface to send the data).

The solution is to change the addresses in one of the networks so that they do not conflict.

Eg:

  • router1: ip: 192.168.0.5 subnet mask: 255.255.255.0
  • router2: ip: 192.168.1.10 subnet mask: 255.255.255.0

MBu

Posted 2013-11-08T13:59:45.640

Reputation: 1 216

I changed the IP range of router 2 and everything seemed to work OK, thanks – James – 2013-11-08T14:40:13.503

0

Your problem lies in your routing table. What you wish is that your wireless router (let's call it 192.168.1.1) is your default router, while the ethernet router (let's call it 192.168.2.1) only generates an extra routing rule, not the default gateway.

You display your routing table by means of

 netstat -nr

where -r stands for "display routes", and "-n" = "do not resolve names. To erase 192.168.2.1 and set 192.168.1.1 as the default gateway:

route delete default
route add default 192.168.1.1

To add now the ethernet router as "just another route",

route -n add -net 192.168.2.0/24  192.168.2.1

Remember that these commands are to be issued as sudo.

MariusMatutiae

Posted 2013-11-08T13:59:45.640

Reputation: 41 321