Results 1 to 10 of 10
Hi,
I have a linux box with 2 nic installed:
ATH0 connects to my local wireless network.
ETH0 connects to a modem which is connected to the external world. (Modem ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-27-2012 #1Just Joined!
- Join Date
- May 2009
- Posts
- 72
Using ssh with multiple nic
Hi,
I have a linux box with 2 nic installed:
ATH0 connects to my local wireless network.
ETH0 connects to a modem which is connected to the external world. (Modem has a static ip address).
I configured my routing so that the default gateway points to my local wireless network. Doing so prevents me from connecting to my box using ssh and the modem static ip address.
If I configure my routing to use the modem as the default gateway then I can ssh into it fine. I can actually ssh into it using both nic with that configuration.
But I need my traffic to go through the wireless network, therefore is there any way to ssh into my box through the modem without it being configured as the default gateway?
- 03-27-2012 #2
Normally, the routing would decide which hardware is used to send information. I vaguely guess that there's something messed with how you designed your network? Could you post a more detailed description of your network containing computers, their subnets and routing configuration?
- 03-28-2012 #3Just Joined!
- Join Date
- May 2009
- Posts
- 72
my interfaces file looks like this:
auto lo
iface lo inet loopback
auto ath0
iface ath0 inet dhcp
madwifi-base wifi0
wireless-mode Managed
up iwconfig ath0 essid XXXXXXXX
up iwconfig ath0 txpower auto
up iwconfig ath0 enc off
up iwconfig ath0 rate auto
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto eth0
iface eth0 inet dhcp
up route del -net default
ifconfig:
ath0: 192.1.2.123
eth0: 184.1.2.234
route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.1.2.0 * 255.255.255.0 U 0 0 0 ath0
184.1.2.0 * 255.255.255.0 U 0 0 0 eth0
default 192.1.2.1 0.0.0.0 UG 0 0 0 ath0
The windows PC I'm using to ssh to the linux box is on the same subnet 192.1.2.0.
- 03-28-2012 #4Could the first byte of the ip address assigned to eth0 be the problem? Please note also that 184.1.2.0/24 is not a valid subnet for private use. There are only a few as mentioned in http://www.ietf.org/rfc/rfc1918.txt. The private address space are three subnets, namely:ifconfig:
ath0: 192.1.2.123
eth0: 184.1.2.234
Cheers10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
- 03-28-2012 #5Just Joined!
- Join Date
- May 2009
- Posts
- 72
I don't think so, it's an external static ip address given by my internet provider accessible from anywhere.
- 03-28-2012 #6
Strange indeed. I've not understood yet how your network is set up. Could you please describe where your computer is (ip/subnet), your "box" that you are ssh'ing into (ip/subnet) and your router (ip/subnet) and all routing devices in between?
- 03-28-2012 #7Just Joined!
- Join Date
- May 2009
- Posts
- 72
My windows pc is located inside an office.
Ip address is 192.1.2.119
Subnet 192.1.2.
Default gateway 192.1.2.1
The linux box has 2 nic:
Ath0 connected to the same network as my windows pc
Ip address 192.1.2.123
Subnet 192.1.2.
Default gateway 192.1.2.1
Eth0 connected to a cellular modem which has a public address of 184.1.2.234
Default gateway 184.1.2.1
I do have to remove one of the default gateways, otherwise the linux box acts erratically (does not connect to the internet), thus the line 'up route del -net default' in my interfaces file.
- 03-30-2012 #8
First, your private subnet is not valid - even though that shouldn't cause problems you should change it to one of the subnets mentioned before. The easiest thing would be to swap the 192 with 10, so that your subnet is 10.1.2.0/24, which in turn is a subnet of the private subnet 10.0.0.0/8.
Second: there are network drivers around that do not properly set up routes on ifup and thus there are cases where you need to do it manually. Of course the default route "default 192.1.2.1 0.0.0.0 UG 0 0 0 ath0" is wrong and should read as "default 184.1.2.1 0.0.0.0 UG 0 0 0 eth0" since that is the "way to the rest of the world". I've seen similar things on a openwrt/kamikaze with pppoe connections and it turned out that it was caused by the drivers shipped with an old 2.4 kernel (please beat me if I'm wrong here - it happened a few years ago).
What distribution are you using on the linux box? Have you searched the web for bug reports regarding your distribution and the kernel you're using? Would be a kernel upgrade an option for you?
How do you ssh into your linux box from your windows host? It shouldn't be "ssh 184.1.2.1" but "ssh 192.168.1.2.123".
CheersLast edited by Kloschüssel; 03-30-2012 at 06:24 AM. Reason: fix typos
- 03-30-2012 #9Just Joined!
- Join Date
- May 2009
- Posts
- 72
I'm not actually showing the real ip addresses because it's irrelevant. My network is fine.
I haven't looked up bugs about this. I'm using a light debian based linux called voyage-linux; kernel 2.6.26-486.
I do have to ssh into 184.1.2.234. This linux box will 'travel' and the only way to support it then will be through the modem.
And it does work if I make 184.1.2.1 my default gateway, but in order for other things to work on my box I wanted to leave my private gateway as my default gateway. I'm just trying to understand why it doesn't work when I do that.
Thanks for the help.
- 04-02-2012 #10Just Joined!
- Join Date
- May 2009
- Posts
- 72
I ended up making the modem my default gateway and creating a specific route for my other needs.


Reply With Quote
