[SLE] Internet ADSL sharing/routing help needed
Now I got my ADSL up and running, next thing is to think about how to share the connection. : ) Can someone help me on this by giving me some one or two lines command to set it up? security is not a big concern now but I need it to work before I can find sometime to got the Linksys router. TIA. : ) Dennis/sg
On Wed, Apr 11, 2001 at 09:30:56PM +0800, Dennis wrote:
Now I got my ADSL up and running, next thing is to think about how to share the connection. : )
Can someone help me on this by giving me some one or two lines command to set it up? security is not a big concern now but I need it to work before I can find sometime to got the Linksys router.
echo "1" /proc/sys/net/ipv4/ip_forward
will set up forwarding on your 'net connected box.
Next you'll have to set up masquerading. If you have a 2.2.x kernel, or a 2.4
kernel with ipchains support, use this command:
ipchains -P forward MASQ
If you use a 2.4 kernel without ipchains support, then you'll need to use the
'iptables' command, but I'm not too hot on iptables at the moment, so I
couldn't tell you exactly what to use.
Also note that this leaves you with no firewall protection at all. Use a SuSE
supplied package, or check out http://netfilter.kernel.org to do this.
Finally, you'll need to set you second computer to point to the 'net connected
one as its gateway. Use this command:
route add default gw
Hi Chris, thanks for your help, I tried it but unfortunately, it doesn't seem to be working. I've tried with modem (56k to internet) and share thru' eth0, yes! it works. But ADSL (eth1 to internet) and share thru' eth0, no, the client end cannot connect to internet. [Internet]----[ADSL modem]----[eth1]----[your two lines input]----[eth0]----[switch]----[client pc, gateway point to eth0 IP] In both cases (on two pc), the client pc is pointed to the host pc (gateway set accordingly). Anything I've missed out? Dennis/sg
echo "1" /proc/sys/net/ipv4/ip_forward will set up forwarding on your 'net connected box.
Next you'll have to set up masquerading. If you have a 2.2.x kernel, or a
kernel with ipchains support, use this command: ipchains -P forward MASQ If you use a 2.4 kernel without ipchains support, then you'll need to use
2.4 the
'iptables' command, but I'm not too hot on iptables at the moment, so I couldn't tell you exactly what to use.
Also note that this leaves you with no firewall protection at all. Use a SuSE supplied package, or check out http://netfilter.kernel.org to do this.
Finally, you'll need to set you second computer to point to the 'net connected one as its gateway. Use this command: route add default gw
These are just generic instructions though, so they won't necessarily work on all networks...
Dennis wrote:
Hi Chris, thanks for your help, I tried it but unfortunately, it doesn't seem to be working.
I've tried with modem (56k to internet) and share thru' eth0, yes! it works.
But ADSL (eth1 to internet) and share thru' eth0, no, the client end cannot connect to internet.
[Internet]----[ADSL modem]----[eth1]----[your two lines input]----[eth0]----[switch]----[client pc, gateway point to eth0 IP]
In both cases (on two pc), the client pc is pointed to the host pc (gateway set accordingly).
Anything I've missed out?
IMHO gateway should not be eth0 if your adsl connection is PPPOE try ifconfig and see if you ahve ppp interface up with an IP adress if so you have to use that address ipchains -A forward -j MASQ -i ppp0 HTH -- Togan Muftuoglu
participants (3)
-
Chris Reeves
-
Dennis
-
Togan Muftuoglu