You cannot bind client software to specific network interfaces, but
you can tell the kernel that you only want to use one network
interface for some IP addresses and the other one for everything else.
This is called "routing", and can be configured using the commands
/sbin/route
and /sbin/ip
.
If I read your question correctly, you want to connect to intranet IP
addresses using interface eth0
and to the Internet using interface
wlan0
.
If you run the command ip route list
, you should see an output
like the following (numbers will be different, and also you can have
more lines in it):
$ ip route list
10.60.44.0/25 dev eth0 proto kernel scope link src 10.60.44.39 metric 1
192.168.80.0/21 dev wlan0 proto kernel scope link src 192.168.84.122 metric 2
[...]
default via 10.60.44.1 dev eth0 proto static
The first two lines tell you about the networks connected to
interfaces eth0
and wlan0
: network traffic directed to computers
on those networks will be directly sent to them through the
corresponding interface.
The last line tells you what the "default route" is: if your computer
wants to talk to a computer on a network it is not attached to (e.g.,
the stackoverflow.com server), it will route traffic via eth0
,
realying through host 10.60.44.1
(called the "default gateway").
So, to route Internet traffic thorugh wlan0
you should ensure that
the last line in the ip route list
output reads something like:
default via A.B.C.D dev wlan0 proto static
where A.B.C.D
is the IP address of the gateway on the wireless LAN.
If the output does not contain "dev wlan0", you can change it with the
command:
sudo ip route change to default dev wlan0 via A.B.C.D
You can find out the correct A.B.C.D
for wlan0
in two ways:
Look into directory /var/lib/dhcp3/
: you should find some
dhclient-...-wlan0.lease
files. Open the most recent one and
search for a line with the string option router
in it: the rest
of the line tells you the IP address A.B.C.D
.
Ask your local network administrators. (Probably the best thing to
do, anyway.)
With this configuration, you should be able to:
- browse the Internet through
wlan0
- browse your Intranet through
eth0
, provided it is on a single network.
If your intranet spans multiple networks, then you will need to add
routes for them - and this is definitely something that requires you
to interact with the local network admins. :-)