LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-08-2004, 11:45 AM   #1
Lynx2112
LQ Newbie
 
Registered: Jun 2004
Posts: 1

Rep: Reputation: 0
Setting up Slackware 9.1 to use multiple network cards?


I have a lan at home and i am currently using my linux box as the primary router for the network.
I am in the process of getting away from dialup and going to Cable (roadrunner). The modem needs a ethernet connection to the computer.
Great! I bought a nice linksys nic for $4 and put it in now my exsisting lan stopped working!

I can bring up both network interfaces via

# ifconfig eth0 up
# ifconfig eth1 up

i can also config them to an ip address

# ifconfig eth0 10.10.97.1 netmask 255.0.0.0
# ifconfig eth1 10.10.97.2 netmask 255.0.0.0

(yes i am aware that this is a class A network)

ok once those devices are brought online the ifconfig shows the ip address
that i have enabled for them.
i can ping 127.0.0.1
10.10.97.1
and 10.10.97.2
but i can not ping out to the other computers on the lan
# ping 10.10.97.3
reply from 10.10.97.1 DESTINATION HOST UNREACHABLE
reply from 10.10.97.1 DESTINATION HOST UNREACHABLE
reply from 10.10.97.1 DESTINATION HOST UNREACHABLE

from the other computer i can not ping the router either
(winxp) ping 10.10.97.1
Request timed out...
Request timed out...
Request timed out...

---------------------------------------
thoughts? ideas?
---------------------------------------
My network professor said that i had to bind them together. As i know little about this subject i was hopeing someone could enlighten me.

I should also let you know that i have taken out each network card and they work just fine without the other one in the computer. So i know it is not the network cards.


Lynx (^.,.^)~

Last edited by Lynx2112; 06-08-2004 at 11:46 AM.
 
Old 06-08-2004, 11:59 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
configure an iptable script to enable NAT, there are many example and tutorials over the net like :
http://www.siliconvalleyccie.com/lin...m#_Toc73696496
 
Old 06-08-2004, 12:10 PM   #3
Toth
Member
 
Registered: Aug 2003
Posts: 83

Rep: Reputation: 15
I believe the problem is that you are putting them both in the same subnet. Thus when you ping 10.x.x.x, your computer doesn't know which ethernet card to use. With both in and only one up you should notice that it should work fine. Configure the one connected to your cable modem to use a different subnet (e.g. 192.168.x.x which is what most home routers etc. use by default).
 
Old 06-08-2004, 01:23 PM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
Quote:
Thus when you ping 10.x.x.x, your computer doesn't know which ethernet card to use.
And what is the purpose of ifconfig then ? On a macintosh, you can add an IP adress for the firewire card with ifconfig and ever in this case the computer know which card to use.

I think the more simple to do is :
- planify the network Lan things (which computer for which adress, enabling DHCP or no...)
- configure a linux box as a nat router which enable IP forward and more (possibility to install proxy etc...)
 
Old 06-08-2004, 01:57 PM   #5
Toth
Member
 
Registered: Aug 2003
Posts: 83

Rep: Reputation: 15
Quote:
Originally posted by keefaz
And what is the purpose of ifconfig then ? On a macintosh, you can add an IP adress for the firewire card with ifconfig and ever in this case the computer know which card to use.
The purpose of ifconfig is to configure network interfaces...properly.

The original poster set the IP address of both cards to 10.x.x.x and the subnet masks of both to 255.0.0.0. The subnet mask is what tells the system when to use the gateway and when to just broadcast on the local network. With a netmask of 255.0.0.0, anytime he attempts to contact any IP address beginning with 10, it should go out on the local interfaces. But since both interfaces begin with 10, how does it know which interface to use? Is it to use both? Neither?

edit, just as a clarification, if the second interface were set to 192.168.1.100 with a netmask of 255.255.0.0, then the computer knows exactly what to do. Anything to 10.x.x.x goes out on the first interface. Anything to 192.168.x.x goes out on the second. Anything else goes through the default gateway. To set the gateway up, see the route manual page. It will be a 10.x.x.x adress or 192.168.x.x address, and thus the system once again knows which interface to use.

Last edited by Toth; 06-08-2004 at 01:59 PM.
 
Old 06-10-2004, 03:21 PM   #6
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
The subnet mask purpose is to separate adress of the machine and adress of the network, with a 10.0.0.0 network you can use 255.255.255.0 or 255.255.0.0 or 255.0.0.0.
Anyway I am more pratical than theorical, but I am sure that you can set 2 network interface with ip adress in the same network, say 10.10.97.1/255.255.255.0 and 10.10.97.2/255.255.255.0

Last edited by keefaz; 06-10-2004 at 06:46 PM.
 
Old 06-10-2004, 06:30 PM   #7
rotvogel
Member
 
Registered: Oct 2003
Posts: 534

Rep: Reputation: 30
It is possible, but if you want to use them both on a different network it is not a very good thing to do. There can be specific reasons to use 2 interfaces in a PC using the same network, load balancing could be a reason. But if that is what you want you will have to do something with routing which will take a lot of reading (LARTC) and iproute2 software. But that is not a standard way of routing / sharing Internet to a LAN.

Most of the times a router uses 2 physical networks which are interconnected by the router. If your default route to a specific address or network (the first route matching in your routing table I assume), it looks for the first match in your routing table and will use the interface that's specified there. It will not use your other interface for that. So it will not use it unless you do something with routing, forcing it to use the second interface.

So if you want to share an Internet connection to a LAN it's better to give the interfaces different addresses on different networks. The router will transport traffic from one network to the other.

I don't know Roadrunner or other non Dutch cable solutions. But I assume your interface connected to the Internet will be configured using DHCP or static address provided by your provider, the only thing for you to do is setting up the interface according to the instructions of the provider and setting up your LAN interface, which is connected to your LAN and activate some kind of NAT using iptables.
 
Old 06-10-2004, 06:52 PM   #8
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
I completly agree but couldn't it be interesting for server or net game developper to do this sort of thing to test net program ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Network Cards ryanroler Slackware 11 01-14-2005 08:18 AM
Unable to forward with multiple network cards dcgva Linux - Networking 2 06-22-2004 02:38 PM
multiple network cards, wireless fell over and died Smerk Linux - Wireless Networking 13 04-08-2003 08:05 PM
multiple network cards in router Smerk Linux - Networking 4 03-06-2003 07:40 PM
VMWare and multiple network cards Syd Nicholson Linux - Networking 0 06-26-2001 07:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration