LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-16-2005, 12:43 PM   #1
tadziu23
LQ Newbie
 
Registered: Oct 2005
Location: poznań, poland
Distribution: Slackware 10.2
Posts: 11

Rep: Reputation: 0
How to share ADSL with linux?


well i guess this forum is my last chance

i've got adsl net connection on usb sagem modem,
and i want to share it with two computers in my
home. i'v got two ethernet cards in linux based
machine (connected to net by usb modem), networked
with other 2 machines by crossover cables.
pinging all 2 computer's works fine, pinging
yahoo.com also works, so all connections are set.
but sharing is not
how to set dhcp.conf?
how to set iptables?

my ifconfig:
Code:
eth0      Link encap:Ethernet  HWaddr 00:08:54:02:E6:D1
          inet addr:100.100.100.40  Bcast:100.100.100.255  Mask:255.255.255.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:0xf00

eth1      Link encap:Ethernet  HWaddr 00:50:BF:4D:50:01
          inet addr:100.100.100.30  Bcast:100.100.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24 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:2184 (2.1 Kb)  TX bytes:0 (0.0 b)
          Interrupt:12 Base address:0x2e00

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:83.23.25.43  P-t-P:213.25.2.40  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:1042 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1156 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:464936 (454.0 Kb)  TX bytes:130931 (127.8 Kb)
(ppp0
is my usb-modem connection with ISP's settings. )

if someone could tell my how to do it or knows some
newbie's-friendly 'howto' set such sharing, please, please
please help
 
Old 11-16-2005, 01:37 PM   #2
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
what distrobution of linux do you use?
the reason i ask, is that firestarter (for gnome but can be used outside of gnome)
is a great little utility that i used to set up my firewall and server at home.
it has a very newbie friendly interface and setup wizard and takes care of iptables and rules for you.
 
Old 11-16-2005, 01:53 PM   #3
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
I don't use dhcp, I configure the computers here with static addresses. I share my ADSL connection with my daughters laptop with these iptables rules. They depend on some kernel functionality so either compile it in or load the modules.
Code:
#!/bin/bash
iptables -A INPUT  -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.4/32 -j MASQUERADE
iptables -A INPUT -s 192.168.1.4/32 -j ACCEPT
iptables -A FORWARD -i ppp0 -o ppp0 -j DROP
iptables -A FORWARD -i ppp0 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT
And I don't have net tools (ifconfig) installed, I use iproute, but it's more or less the same
Code:
ip addr add 192.168.1.3/24 dev eth0 &&
ip link set eth0 up &&
ip route add 192.168.1.4 dev eth0 &&
echo 1 > /proc/sys/net/ipv4/ip_forward
My computers 192.168.1.3, my daughters laptop is 192.168.1.4. I don't think you need the `link set up'command with ifconfig. Hope that helps.
 
Old 11-16-2005, 04:19 PM   #4
tadziu23
LQ Newbie
 
Registered: Oct 2005
Location: poznań, poland
Distribution: Slackware 10.2
Posts: 11

Original Poster
Rep: Reputation: 0
i use slack.

if above's sollution won't work, i'll try firestarter then
(hope it works with K)...
regards
 
  


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 detect ADSL user share its network to more pepole yufeixiaoyu Linux - Networking 5 08-18-2005 10:24 AM
samba: linux mounted share = choppy playback, windows mounted share = smooth kleptophobiac Linux - Software 2 04-10-2005 08:23 AM
Share Adsl Connection With Windows Xp myk3 Linux - Networking 3 11-16-2003 09:47 PM
ADSL USB RedHat 9 share Internet gbg Linux - Networking 6 08-18-2003 08:58 AM
ADSL USB Share Internet over eth0 gbg Linux - Networking 0 08-13-2003 06:44 AM

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

All times are GMT -5. The time now is 02:53 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