LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-28-2006, 08:01 PM   #1
kfaday
LQ Newbie
 
Registered: Sep 2004
Location: argentina
Posts: 9

Rep: Reputation: 0
Internet connection sharing in slackware - nic issue


Hello
I want to share my internet connection using slackware. Let me explain my configuration:

I have two computers, the server with two nics (one connects to the adsl modem, and the other one to the other computer) and the client with one nick. On windows xp, they both have internet.
Both computers have slackware 10.2 installed. When the server is on windows and the client is on slackware, the client has internet access.
When the server is on slackware, it has internet access, but the client doesn't. (i use Roaring Penguin pppoe to connect to adsl in the server).
How do i share my internet connection?


Also, i have a Via VT6122 nic in the server that connects to my client computer. i installed the drivers, and on ifconfig, eth1 appeared, but now i rebooted, and i don't have eth1. (the server connects to internet using a 3com nic, which is seen as eth0) Here's the result on ifconfig:

-----------------------------------------------------------------
eth0 Link encap:Ethernet HWaddr 00:50A:BF:B5:92
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1272 errors:0 dropped:0 overruns:0 frame:0
TX packets:1043 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:914520 (893.0 Kb) TX bytes:223434 (218.1 Kb)
Interrupt:10 Base address:0xc800

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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

ppp0 Link encap:Point-to-Point Protocol
inet addr:190.49.176.50 P-t-P:200.51.241.231 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:1232 errors:1270 dropped:0 overruns:0 frame:0
TX packets:1000 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:884950 (864.2 Kb) TX bytes:196643 (192.0 Kb)
-----------------------------------------------------------------

How can i configure my eth1?

I'd really appreciate the help


Thanks

Regards,
Martin
 
Old 08-29-2006, 02:15 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
To share an Internet connection from one interface to another, you can use IPTables:

Code:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
Where eth0 is your connection to your modem, and eth1 is the connection to the other computer. You will want to put this in your rc.local file, so that it will run at boot. You will also want to make /etc/rc.d/rc.ip_forward executable.

Now, you will have to configure IPs for both eth1, and the NIC in the Windows client. If you want to setup an IP for eth1, you can do so in /etc/rc.d/rc.inet1.conf.

You could also run a DHCP server off of eth1, but that is a bit more involved, and probably not worth the time for a single client.
 
Old 08-29-2006, 06:49 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
Your actual external interface is ppp0 not eth0.
$IPTABLES -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Lots of info on the web on iptables and configuring a firewall.

There are also serveral GUI frontends for configuring iptables like firestarter.
 
Old 08-30-2006, 09:39 PM   #4
kfaday
LQ Newbie
 
Registered: Sep 2004
Location: argentina
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for your answers.

i tried with:

iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT

and it didn't work.
Any ideas?
What should i do next?

Ty!
 
Old 08-30-2006, 09:51 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
You need to fix the no eth1 problem.
Is the module loading?
 
Old 08-31-2006, 09:27 PM   #6
kfaday
LQ Newbie
 
Registered: Sep 2004
Location: argentina
Posts: 9

Original Poster
Rep: Reputation: 0
yes, i think so.... i run ifconfig eth1 and it gives me something like this:

eth0 Link encap:Ethernet HWaddr 00:50A:BF:B5:92
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1272 errors:0 dropped:0 overruns:0 frame:0
TX packets:1043 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:914520 (893.0 Kb) TX bytes:223434 (218.1 Kb)
Interrupt:10 Base address:0xc800

(this was taken from the post above... this is for eth0, but i get the same result for eth1).

so i believe it's working
 
Old 08-31-2006, 09:37 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,341

Rep: Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231Reputation: 2231
FYI eth0 is not assigned an IP address because you are using rp-pppoe.
eth1 is working but it is not being assigned an IP address. Configure it with static IP address.

http://www.slackware.com/config/network.php
 
  


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
Sharing internet connection between Slackware and XP via crossover cable islord Linux - Networking 3 01-24-2005 10:38 AM
Internet connection sharing between 2 slackware machines Random`Zero Linux - Networking 6 01-03-2005 11:22 PM
Internet Connection Sharing In SUSE 9.1 Personal with SIngle NIC ikm19 Linux - Networking 4 06-24-2004 11:25 AM
Windows Xp, Slackware Internet Connection Sharing. Volcom Slackware 14 07-04-2003 06:18 PM
NIC Detection, for Connection sharing Primetime Linux - Networking 3 01-06-2003 09:30 AM

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

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