LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Setting up Slackware 9.1 to use multiple network cards? (https://www.linuxquestions.org/questions/slackware-14/setting-up-slackware-9-1-to-use-multiple-network-cards-191118/)

Lynx2112 06-08-2004 10:45 AM

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 (^.,.^)~

keefaz 06-08-2004 10:59 AM

configure an iptable script to enable NAT, there are many example and tutorials over the net like :
http://www.siliconvalleyccie.com/lin...m#_Toc73696496

Toth 06-08-2004 11:10 AM

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).

keefaz 06-08-2004 12:23 PM

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...)

Toth 06-08-2004 12:57 PM

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.

keefaz 06-10-2004 02:21 PM

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

rotvogel 06-10-2004 05:30 PM

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.

keefaz 06-10-2004 05:52 PM

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 ?


All times are GMT -5. The time now is 07:15 PM.