Thread: Eth0 and eth1
View Single Post

  #4 (permalink)  
Old 07-21-2004
Captain Beefheart
 
Posts: n/a
Default Re: Eth0 and eth1

Captain Beefheart wrote:

> As mentioned earlier in this forum, I'm setting up a VPN system.
>
> This involves having two network cards on one PC - eth0 and eth1. Because
> I want to learn as much as I can about networking, I'm doing it the hard
> way and avoiding a distro or package which will do all this for me.
>
> However, I'm having trouble understanding how I can add separate routes
> for each card. One will connect to the WAN and have an "internet IP"
> whilst the other will connect to a private subnet with a 192.168.*.*
> address. Clearly they have separate gateway addresses.
>
> What files need to be altered? I'm using SUSE, although not for any
> particular reason (the install disc was simply at hand). However, YAST2
> only seems to want to let me have one default route which it then applies
> to both cards.
>
> Also, is it possible to have separate DNS configs for both cards?


Okay - I've just spent a couple of hours unsuccessfully trying to get a
Fedora Core 2 box to work with two ethernet cards and two static IPs. Card
one had a 192.* private subnet address whilst card two had a static
internet IP assigned by our ISP. I've not setup a firewall or anything
fancy - just installed the distro and tried to configure the cards.

No joy. Card 2 (eth1 - Net IP) could ping everything merrily but card 1
(eth0 - 192.*) couldn't ping anything, such as a computer on its own
subnet.

Each card had separate gateway addresses correctly filled in. The ACT light
on the back of the non-working card flashed amber occassionally (normally
green for happy data transfers). But I don't know what this means.

As far as I can see it, this problem might be caused by three things:

1) Some subnetting weirdness (subnet for the eth0 (192.*) was 255.255.255.0,
whilst subnet for the Internet IP card (eth1) was 255.255.255.224). I read
somewhere that I might have to match the subnets for routing to work...?
Thinking about it logically, these two networks, even though they're
occuring at my PC, need to be joined by a router if they have different
subnet masks... so how do I configure a router *inside* my Linux setup? ...
leads me onto ....

2) Routing troubles (route -n reveals both cards + gateways are in the list
but I didn't copy and paste it to reproduce here - sorry).

3) Some weird default IPtables behaviour on behalf of Fedora Core 2,
although I did deactivate the firewall AFAICT.

Does anybody know of a good tutorial to introduce the concept of setting up
two network cards under Linux in the arrangement I've described? I'm
learning about the technology of networking as I go along so saying
something like "read the route/ifconfig man page!!" doesn't help - it's a
little above my level and assumes more knowledge than I currently have.

I've found tutorials on setting up IPtables, tutorials on setting up
firewalls, tutorials on configuring kernel modules for two cards, and
virtually everything else, But I can't find a tutorial on the *actual*work*
of configuring the network card IPs and routing. It's as if you're already
expected to know this.


Reply With Quote