LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2005, 09:14 AM   #1
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Rep: Reputation: 33
Share Internet w/ 2 NICs


I would like to access the Internet with my (Slackware 10.2) Laptop through my (Debian Testing) Desktop.

The Desktop has 2 NICs (one on-board [eth1] and one card [eth0]). I have DSL plugged into eth1.

I originally configured access with pppoeconf and it works just fine.

Is it possible to plug my Laptop into the eth0 card and get access? Or, do I need some extra hardware like a router or switch?
 
Old 11-24-2005, 10:26 AM   #2
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
if you are just going from ethernet connector to ethernet connector you do not need a router or switch, but you do need a crossover cable. If you set it up like this.

DSL --------> eth1 | debian| eth0 -------------------------------> eth0 |slackware|

for your debian computer to act as a router you need a crossover ethernet cable
about 15 bucks at Radioshack. or if you use a hub or switch, you do not use a crossover cable.

either way, you have your debian computer acting as a firewall/ router for the slackware laptop.
the easiest way , in my opinion, is to use firestarter. its a simple-to-use, gui app that sets up your home network for you with simple wizards.

take whatever ethernet card is not on the DSL on your debian box, and bring up the other as your server-to-slackware card , kinda like this:

as root:

ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

thats if eth0 is not the card on the dsl otherwise use eth1

then on the slackware system, set up a static ip like this

as root:

ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

then on debian, use firestarter to share your internet connection. don't select dhcp
just folllow the wizard, and post any questions here.

good luck

Last edited by nephish; 11-24-2005 at 10:27 AM.
 
Old 11-25-2005, 01:35 AM   #3
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Original Poster
Rep: Reputation: 33
Cool thanks. I'll stop buy the electronics store after work and get a cross-over cable. I'll report back from my laptop
 
Old 11-26-2005, 07:28 AM   #4
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Original Poster
Rep: Reputation: 33
Ok, I did all of the above, but I can't get to the Internet from the Laptop. But, I can ping my desktop and sftp to the Desktop.

Hmmm...I don't know.

Perhaps it is a dhcp thing?
 
Old 11-26-2005, 08:14 AM   #5
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
ok, you should not need to set up dhcp if you are only going to share with one computer, you can, of course, but i find it simpler to go static.

you are connected, that is the main part. it could be your dns servers are not set on the slackware unit. try this,
open a terminal and see if you can ping google by its ip address.
ping -c 3 216.239.39.99

see if that works.
then type (some systems require you to be root for this)
ifconfig
and post what it gives you here.

also, what window manager are you using on both systems ?

let us know
 
Old 11-26-2005, 08:43 AM   #6
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Original Poster
Rep: Reputation: 33
On the Slackware 10.2 box is KDE 3.4.

In a terminal, ping -c 216.239.39.99 outputs:
connect: Network is unreachable.


The Desktop is Debian Testing and right now I'm running Icewm.
 
Old 11-26-2005, 09:04 AM   #7
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
ok, from the slackware laptop, try to ping the debian computer.

then try to ping slack from debian

make sure in debian that you have both network interfaces up

do an ifcongfig on both and let us know the results of just the eth0 or eth1 part. i think you gotta be root to do ifconfig on debian, maybe slack too.

i think konsole lets you copy and paste.

let us know
 
Old 11-26-2005, 09:25 AM   #8
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Original Poster
Rep: Reputation: 33
The Debian Box tries to ping the Laptop
Code:
desktop:# ping -c 3 198.168.1.2
PING 198.168.1.2 (198.168.1.2) 56(84) bytes of data.

--- 198.168.1.2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
Here is ifconfig on the Debian Box:

Code:
 eth0      Link encap:Ethernet  HWaddr 00:04:5A:45:41:8C  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::204:5aff:fe45:418c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:81 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:3 dropped:0 overruns:0 carrier:6
          collisions:0 txqueuelen:1000 
          RX bytes:7822 (7.6 KiB)  TX bytes:21199 (20.7 KiB)
          Interrupt:177 Base address:0xe800 

eth1      Link encap:Ethernet  HWaddr 00:07:E9:A9:D7:F5  
          inet6 addr: fe80::207:e9ff:fea9:d7f5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10350191 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10389382 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:909972577 (867.8 MiB)  TX bytes:2661855707 (2.4 GiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2519 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2519 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:170874 (166.8 KiB)  TX bytes:170874 (166.8 KiB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr: :)  P-t-P:217.0.116.53  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:47643 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35710 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:55345341 (52.7 MiB)  TX bytes:3695825 (3.5 MiB)
The Laptop tries to Ping the Desktop:
Code:
ping -c 1 192.168.1.1
PING 198.168.1.1 (198.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.315 ms

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min /avg/max/mdev = 0.315/0.315/0.315/0.000 ms
Ifconfig on the Laptopn looks like:
Code:
eth0      Link encap:Ethernet  HWaddr 00:10:A4:F0:AE:D3  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:46 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:19263 (18.8 Kb)  TX bytes:9114 (8.9 Kb)
          Interrupt:3 Base address:0x300
Thanks for all the help. Looks like we're close...
 
Old 11-26-2005, 09:36 AM   #9
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
yeah, i think we are close too. what firewall are you using on the debian box ?
i had a home net set up with debian a few months ago. ( got geeky and switched to arch) but it was set up the same way. dsl to debian to another computer. i remember that i sometimes had to restart the firewall to get it to work. if you are using firestarter, stop the firewall and restart it. best to open it from a terminal, so if it fails, you can see what happened easier.
also, make sure you have internet connection sharing enabled in your preferences.

let me know
 
Old 11-26-2005, 09:43 AM   #10
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Original Poster
Rep: Reputation: 33
I tried stopping the firewall then restarting, but no dice. I'm using Firestarter and Internet connection sharing is enabled in the preferences.
 
Old 11-26-2005, 09:56 AM   #11
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
on firestarter, there is a policy tab.
do you have a rule in the first box that allows connection from
192.168.1.2 (or LAN)
if not, you can add one by right clicking in that window and selecting 'add rule'

also, does firestarter give you a blue circle with the little arrow in it ?
or does firestarter fail ?

Last edited by nephish; 11-26-2005 at 09:57 AM.
 
Old 11-26-2005, 10:04 AM   #12
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Original Poster
Rep: Reputation: 33
Nope, I didn't have that---but I do now. I can now ping the Laptop from the desktop, but still no net on the Laptop.

Yep, got the blue circle in Firestarter.

Last edited by Optimistic; 11-26-2005 at 10:13 AM.
 
Old 11-26-2005, 10:13 AM   #13
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
good. we are getting closer.
try to ping debian from slack
if that works, try to ping google
( ping -c 216.239.39.99 ) by its ip address.

if it does not work, either restart your slack network.
i think its /etc/rc.d/network restart
or /etc/init.d/network restart.
or reboot the laptop and see what happens
 
Old 11-26-2005, 10:38 AM   #14
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Original Poster
Rep: Reputation: 33
Ok, we are very close now.

Out of frustration I re-ran the netconfig tool in Slackware setting it up for a static ip address, then restarted the box. After rebooting I could ping google---using the ip address. I opened a browser and tried google, but it could not be found. So, I tried the IP address in the browser and success! So, it looks like a name-resolving problem now with the Slackware box.

I remember an option in the netconfig tool asking if I would be accessing a nameserver. I think I said no, and I bet that is where I went wrong.

One more reboot should do it.

I'll report back.
-------------------

Blah. It didn't work. I can still go to google via the IP address, but not with text. I had to give the netconfig tool an address for the nameserver and I used the desktop IP (192.168.1.1), maybe this wasn't right? Or, maybe I must do something different with the Desktop now?

Last edited by Optimistic; 11-26-2005 at 10:49 AM.
 
Old 11-26-2005, 10:49 AM   #15
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
cool, yeah, let me know. DNS is the only thing missing now.
 
  


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
How to enable 2 NICs and share internet to a windows PC using Opensuse 10.0 OSS mailavj SUSE / openSUSE 8 11-16-2005 02:06 PM
NICs and Internet - Need Help theGrayFox Linux - Hardware 3 06-30-2004 05:53 AM
Two nics, no internet Cheza Linux - Wireless Networking 1 05-06-2004 01:01 PM
routing two NICs to internet pero Linux - Networking 4 01-09-2004 05:36 PM
2 NICs w/RTL8139, no internet Peff Linux - Networking 3 11-29-2003 02:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:22 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
Open Source Consulting | Domain Registration