LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 04-23-2008, 07:14 PM   #1
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076

Rep: Reputation: 205Reputation: 205Reputation: 205
http forwarding question


I have 2 computers networked over a crossover cable and 2 ethernet cards sally and sue
I can shh to eather one from the other
and ping back and fourth betwineen the two computers
now sue has another ethernet card conneced to a ADSL router (using DHCP )
this is my inter net connection
SO
I want sue to share her internet connection with sally
how do I do this ?
 
Old 04-23-2008, 08:18 PM   #2
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
We'll assume that sue is running Linux. If so, you need to do several things:
make sure that the network segment connecting sally and sue is using a Private Networking address range;
enable ip_forwarding on sue;
set up Network Address Translation on sue;
go read about how to set up a firewall to protect this lash-up from the bad guys out there on the Internet.

Fortunately, I have written a bit about this on my website: http://www.digitalelephant.org/
Follow the menu there for Linux Config/Network Setup/Address Translation. Other parts of the Network Setup section may also be of interest.
 
Old 04-23-2008, 08:18 PM   #3
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
This is one way to do it... make sure to change the ppp0 to the correct label for the card that is plugged into the dsl.

#!/bin/bash
/sbin/modprobe ipt_MASQUERADE
/usr/sbin/iptables -F; /usr/sbin/iptables -t nat -F; /usr/sbin/iptables -t mangle -F
/usr/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
/usr/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/usr/sbin/iptables -A INPUT -m state --state NEW -i ! ppp0 -j ACCEPT
/usr/sbin/iptables -P INPUT DROP
/usr/sbin/iptables -A FORWARD -i ppp0 -o ppp0 -j REJECT
 
  


Reply



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
ssh tricks for http forwarding.. assasukasse Linux - Security 4 09-30-2007 07:35 AM
http port forwarding sanjibgupta Linux - Networking 2 04-27-2007 01:02 PM
Forwarding HTTP esquilo Linux - Networking 7 06-17-2005 02:47 PM
iptables - http port forwarding kevsco77 Linux - Newbie 2 01-23-2005 11:34 PM
belkin router http port forwarding illtbagu Linux - Networking 3 08-16-2003 02:44 PM

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

All times are GMT -5. The time now is 11:16 PM.

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