Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-08-2004, 11:45 AM
|
#1
|
LQ Newbie
Registered: Jun 2004
Posts: 1
Rep:
|
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.
|
|
|
06-08-2004, 12:10 PM
|
#3
|
Member
Registered: Aug 2003
Posts: 83
Rep:
|
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).
|
|
|
06-08-2004, 01:23 PM
|
#4
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,794
|
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...)
|
|
|
06-08-2004, 01:57 PM
|
#5
|
Member
Registered: Aug 2003
Posts: 83
Rep:
|
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.
|
|
|
06-10-2004, 03:21 PM
|
#6
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,794
|
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.
|
|
|
06-10-2004, 06:30 PM
|
#7
|
Member
Registered: Oct 2003
Posts: 534
Rep:
|
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.
|
|
|
06-10-2004, 06:52 PM
|
#8
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,794
|
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 08:21 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|