LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-05-2005, 09:15 PM   #1
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
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
 
Old 10-06-2005, 04:08 AM   #2
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Rep: Reputation: 139Reputation: 139
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
 
Old 10-06-2005, 04:47 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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
 
Old 10-06-2005, 09:45 AM   #4
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Original Poster
Rep: Reputation: 45
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.
 
Old 10-06-2005, 01:51 PM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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
 
  


Reply



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 RADIUS servers on a single machine skiros Linux - Software 3 11-02-2005 06:48 AM
Samba with multiple connections from single XP machine jqcaducifer Linux - Networking 11 11-17-2004 02:53 PM
transparent proxy on a single machine kscott121 Linux - Networking 2 06-27-2004 08:37 PM
Configuring postfix for single-user, dial-up machine axa_aaa Linux - Newbie 0 03-08-2004 07:11 AM
One Machine, Multiple NICs, and a single Newbie CozyMel Linux - Networking 2 10-09-2002 12:53 AM

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

All times are GMT -5. The time now is 05:39 PM.

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
Open Source Consulting | Domain Registration