Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to share adsl connection
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
scereze
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2002
Posts: 132

PostPosted: Tue Aug 19, 2003 2:31 pm    Post subject: How to share adsl connection Reply with quote

Hi,

I want to share my adsl line with two other computers at home. I'm connected through ppp0 and want to share the connection on my two ethernet card eth0 and eth1.

root@Gentoo dhcpc # ifconfig -a

eth0 Lien encap:Ethernet HWaddr 00:10:A7:1B:3F:56
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:100
RX bytes:0 (0.0 b) TX bytes:4720 (4.6 Kb)
Interruption:11 Adresse de base:0xf000

eth1 Lien encap:Ethernet HWaddr 00:0D:61:05:EF:DA
BROADCAST 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 lg file transmission:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interruption:12 Adresse de base:0x6000

lo Lien encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:76 errors:0 dropped:0 overruns:0 frame:0
TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:3828 (3.7 Kb) TX bytes:3828 (3.7 Kb)

ppp0 Lien encap:Protocole Point-à-Point
inet adr:81.248.107.183 P-t-P:193.253.160.3 Masque:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:9178 Metric:1
RX packets:122405 errors:0 dropped:0 overruns:0 frame:0
TX packets:136424 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:3
RX bytes:78981048 (75.3 Mb) TX bytes:31993055 (30.5 Mb)


I don't know where to start. Any document online talking about this ?

thanks for any help
Back to top
View user's profile Send private message
barlad
l33t
l33t


Joined: 22 Feb 2003
Posts: 673

PostPosted: Tue Aug 19, 2003 2:52 pm    Post subject: Reply with quote

First you need to know what network card you are using to connect to the internet. Then, you can just use the "Masquerading HOW TO" to share your connection. It's quite easy. 10 minutes of reading and you should be good to go.
Only thing you have to do is emerge iptables and compile your kernel with all the necessary modules but all of that is explained in the HOW TO.
Back to top
View user's profile Send private message
scereze
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2002
Posts: 132

PostPosted: Wed Aug 20, 2003 3:26 pm    Post subject: Reply with quote

I'm connection to internet through a usb adsl modem using ppp.
I have two nic eth0 et eth1 and want to use them to share the connections with two others computer. one under linux and one under win98

I have found a tutorial about Masqurading under gentoo.

http://webpages.charter.net/decibelshelp/LinuxHelp_IPtables.html#ip_masq

I copy a script to set the iptables rules and I tried to modify it for my case:
-----------------------------------------------------------------------------
#!/bin/sh
iptables -t nat -F
iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT
iptables -A FORWARD -i ppp0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o ppp0 -j ACCEPT
iptables -A FORWARD -j LOG
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE


------------------------------------------------------------------------------

But still doesn't work.

Any idea ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum