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.
|
 |
10-05-2005, 09:15 PM
|
#1
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Rep:
|
configuring two NIC's on single machine
Hello all,
i've two systems, one desktop and other one is laptop.
desktop is connected to internet using ethernet ADSL modem ( so engaging my lan card )
Now i would like to bring my laptop too to internet, using desktop as gateway.
so i plugged one more NIC in the desktop machine.
Now is there any trap in configuring them ???
i mean..............if they are same, then need to compile kernel....
or............the subnet mask should not be the same etc etc..
i'm googling parallely.........but in order to have proper guidance i'm firing this query
regards
|
|
|
10-06-2005, 04:08 AM
|
#2
|
Senior Member
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425
Rep: 
|
Hi
I have the same sort of setup, except the second card goes to a hub. All you need to do is modify your /etc/rc.d/rc.inet1.conf with some details for your card. I use a static IP address on eth1 and dhcp on eth0.
Then restart /etc/rc.d/rc.inet1 and maybe rc.inet2 if you have a firewall script and it has been modified to allow you to access the internet from your laptop.
Calling ifconfig -a should then with any luck show your card.
Samac
|
|
|
10-06-2005, 04:47 AM
|
#3
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
All the information you need is on your local hard disk....
Read /usr/doc/Linux-HOWTOs/DSL-HOWTO and especially paragraph 8.5. Setting up Linux as a Router
If that does not answer all your questions, feel free to add to this topic.
Cheers, Eric
|
|
|
10-06-2005, 09:45 AM
|
#4
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Original Poster
Rep:
|
Hello,
i did some hit and trial methods.
since the IP of my modem is 192.168.1.1, so to the NIC to which it is connected, i've assigned the static IP 192.168.1.2 with netmask value 255.255.255.0.
And to other NIC i.e eth1 i assigned IP ( /etc/rc.d/rc.inet1.conf ) 120.168.0.1 and to laptop 120.168.0.2 with netmask value 255.255.0.0 to both.
Now everything is working fine.
But now i'm googling and doing further experiments to find out whether it was necessary to assign different net mask values and different class address to the two NIC's or not and hence what other combinations could be made.
Thanks to "samac" and "Alien Bob".
regards
Code:
root@bond:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:4C:77:13:4F
inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1074 errors:0 dropped:0 overruns:0 frame:0
TX packets:1175 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:536547 (523.9 Kb) TX bytes:176043 (171.9 Kb)
Interrupt:12 Base address:0xab00
eth1 Link encap:Ethernet HWaddr 00:A1:B0:10:19:2E
inet addr:120.168.0.1 Bcast:120.168.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:10 Base address:0xcc00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:74 errors:0 dropped:0 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5012 (4.8 Kb) TX bytes:5012 (4.8 Kb)
Last edited by b0nd; 10-06-2005 at 09:46 AM.
|
|
|
10-06-2005, 01:51 PM
|
#5
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
My advice;
Do not use those addresses 120.168.0.1 and 120.168.0.2 because they are existing IP addresses out there on the Internet. For home and other internal use, a whole lot of IP addresses are available that you will never find on the Internet.
The range 192.168.0.0/255.255.0.0 is available for private use, for instance.
So are the ranges 10.0.0.0/255.0.0.0 and 172.16.0.0/255.240.0.0.
So, it would look better if you change 120.168.0.1/255.255.0.0 and 120.168.0.2/255.255.0.0 to 192.168.0.1/255.255.255.0 and 192.168.0.2/255.255.255.0.
Be sure to use the 255.255.255.0 netmask so that these new IP addresses are outside the IP address range of the other addresses 192.168.1.1/255.255.255.0 and 192.168.1.2/255.255.255.0.
Eric
|
|
|
All times are GMT -5. The time now is 10:14 AM.
|
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
|
|