two network interfaces active at the same time?

Lucia Sanchez lu at gusilu.net
Mon Jun 19 17:00:44 UTC 2006


Christopher J. Bottaro wrote:
> 
> Actually, you can have two default gateways (as listed by the route
> command), but only the top one will "match" and thus be active, but I know
> what you're saying and I know not to do that.
> 

Kubuntu sometimes messes up and has two entries as "default" (as seen
with the root command), this is what I said cannot happen.  I've *seen*
it happen when playing around with ppp, but it's less than a desirable
situation since chances are that you'll end up network-less (in the "ppp
needs to overwrite de default route to set up an VPN" situation).  So
that's why I was asking :)

> This is what I'm going for:
> 
> $ route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref Use Iface
> 192.168.1.0     *               255.255.255.0   U     0      0   0   ath0
> 192.168.2.0     *               255.255.255.0   U     0      0   0   eth0
> default         192.168.1.1     0.0.0.0         UG    0      0   0   ath0
> 
> Read: "All traffic destine for 192.168.1.* goes through device ath0.  All
> traffic destine for 192.168.2.* goes through device eth0.  All other
> traffic defaults to using gateway 192.168.1.1 (through device ath0)."
> 

Ok, straightforward enough.

> That's what I want, but I don't know how to setup the devices.  I don't know
> what GUI to use.  Furthermore, I don't even know what text files to edit
> because I'm a Fedora user and I'm used to editing stuff
> in /etc/sysconfig/network-scripts, which doesn't exist in Kubuntu.
> 

Weeeeell, I wouldn't know about GUI programmes to do this since I'm more
of a command line person -- so if anyone does, speak up!

> What I would do in Fedora is the system-config-network GUI to initially
> setup my network scripts for the various devices I want.  Then I might
> tweak them by hand a little.  Then simply use ifup/ifdown to turn them on
> and off.  I was actually hoping to go pure GUI in Kubuntu (getting older,
> not liking editing text files anymore...;)).

I'll give you the text files answer, just in case no-one comes up with a
GUI alternative.

The file you're looking for is /etc/network/interfaces

As usuall, before messing up with this file, make a backup.  In order to
try out whatever changes you've made "sudo /etc/init.d/networking
restart" should work.

Supposing the IP addresses for your interfaces are static, I suggest the
following content for that file (change settings as appropriate):


# The loopback interface
auto lo
iface lo inet loopback

# The first network card
auto eth0
iface eth0 inet static
        address 192.168.2.2
        netmask 255.255.255.0
        broadcast 192.168.2.255

auto ath0
iface ath0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        broadcast 192.168.1.255
	gateway 192.168.1.1

Good luck!
-- 
Lu.

------------------------------------
 I will live forever or die trying.
------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 186 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20060619/b26a62ab/attachment.sig>


More information about the kubuntu-users mailing list