Arkisto October, 2011

Wired LAN and UMTS together – simultaneously

Oct 14, 2011 in Howto

To start with, my network connection is normally like this, with two NICs:
1. eth0 for LAN, in a NAT port on the ADSL box, fixed IP, 192.168.x.x subnet.
2. eth1 for WAN, in a bridged port on the ADSL box, dynamic IP, provider’s DHCP..

This way the main machine has a direct external IP address
and all other machines can connect to its NFS and CIFS (Samba) directories in the 192.168.x.x subnet.

The other machines have their NICs connected via a switch to a NAT port on the ADSL box, 192.168.x.x subnet.

This way they all get their Internet connections via the ADSL box and they can use the same shared directories on the main machine, in subnet address 192.168.x.x.

Everything is configured using ifup.
Always works. Except that…

Now, my cable was cut out in the yard. An Excavator had bad maps or shaky hand or something.

So I thought I’ll set up an emergency network where I replace eth1 with a UMTS modem.

Since eth1 got useless, I first disabled it altogether using YaST.

I then changed first from ifup to network manager and nm-applet to run UMTS.
Plugged in the UMTS stick, it got recognized and was trivial to configure.

Problem:

It got up and it got an IP, but there was no internet connection.
Checked the nameservers, no joy.

Disconnected the LAN (eth0) in nm-applet
Now I got connected to the Internet, but no LAN, ofcourse, I just disconnected it.

Connected eth0 again, LAN was there but no Internet. It was one or the other, not both.

Apparently the network manager couldn’t (or I couldn’t) handle this situation.

(I’ll be grateful to hear of anyone who knows how all this can be done in network manager).

At this point I went to Usenet and as usual, got good advise from there.

Solution:

The reason to this problem was that the default route was pointing to the old wired connection.
This could be seen with ‘/sbin/route -n’

So I disconnected eth0 again to get Internet, installed wvdial and umtsmon.
Then I disconnected UMTS cobnnection, went to YaST and changed back to ifup.

After that I removed the old default route (as root) with
‘route del default’

Then kicked UMTS up again (with umtsmodem, very handy program).
Now everything was there, both LAN and Internet:

Steps:

1. LAN plugged

2. UMTS stick plugged, not connected yet.

3. /sbin/route del default

4. UMTS connected

You’re done.

Running Firefox remotely over ssh

Oct 11, 2011 in Howto, Remote administration

I’m connected to a remote machine over ssh (‘ssh -X remotemachine’).

I try to launch Firefox
user@linux-iek6:~> firefox

It launches, yes, but locally! Quite surprising to me.
OK, so I stop it and do some google searching…

Then, to make it run on the remote machine I command:

user@linux-iek6:~> firefox -no-remote
GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
GConf Error: No D-BUS daemon running

OK, it runs remotely now, but I stop it again and do some google search again.
Then, to get rid of that problem I first command: export $(dbus-launch)

user@linux-iek6:~> export $(dbus-launch)

and then:

user@linux-iek6:~>firefox -no-remote
*** nss-shared-helper: Shared database disabled (set NSS_USE_SHARED_DB to enable).

Some google again…
To get rid of also that I command:
user@linux-iek6:~>export NSS_USE_SHARED_DB=ENABLED

and then:
user@linux-iek6:~>firefox -no-remote

and now it runs on the remote machine without errors!

So I put all those in a script:

#!/bin/bash
export $(dbus-launch)
export NSS_USE_SHARED_DB=ENABLED
firefox -no-remote &

That tiny thing does all the above nicely.
If you like to see what it’s doing add -x to the first line:

#!/bin/bash -x