Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sharing Internet 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
homeobocks
Guru
Guru


Joined: 19 Dec 2003
Posts: 345
Location: I'm from Canada, and they say I'm a little slow . . . eh?

PostPosted: Wed Feb 04, 2004 2:55 am    Post subject: Sharing Internet Connection Reply with quote

Here's the situation. There are two computers involved. Greedo is a Windows XP box (not mine, my family's), and IG-88 is a Gentoo box. IG-88 connects to Greedo from IG-88.eth0, to Greedo.eth1. Greedo.eth2 conencts to the internet. I am going to install Gentoo on another hdd on Greedo, but I still want the connection to be shared (so IG-88 can access the internet). This diagram should clear things up:

Code:

                +-------------+              +----------------+
Internet===+----+ Greedo      |----+====+----+  IG-88         |
           |eth0|             |eth1|    |eth0|                |
           +----+-------------+----+    +----+----------------+


Anyways, I am going to do the Knoppix install. How would I make the connection shared? Please explain it well, as I am a recent RedHat convert.

Thanks a lot.
_________________
HOW DO I SHOT WEB
Back to top
View user's profile Send private message
homeobocks
Guru
Guru


Joined: 19 Dec 2003
Posts: 345
Location: I'm from Canada, and they say I'm a little slow . . . eh?

PostPosted: Wed Feb 04, 2004 5:40 am    Post subject: Reply with quote

bump
_________________
HOW DO I SHOT WEB
Back to top
View user's profile Send private message
homeobocks
Guru
Guru


Joined: 19 Dec 2003
Posts: 345
Location: I'm from Canada, and they say I'm a little slow . . . eh?

PostPosted: Wed Feb 04, 2004 7:35 pm    Post subject: Reply with quote

bump :evil:
_________________
HOW DO I SHOT WEB
Back to top
View user's profile Send private message
triwebb1
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2003
Posts: 87

PostPosted: Wed Feb 04, 2004 11:33 pm    Post subject: Reply with quote

It is called masquerading in linux. Do this on Greedo:
Code:
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

That will enable masquerading going out your external interface, and allow ip forwarding. This is NAT/PAT.
Back to top
View user's profile Send private message
john7002
Apprentice
Apprentice


Joined: 21 Jan 2004
Posts: 238
Location: United Kingdom

PostPosted: Wed Feb 04, 2004 11:45 pm    Post subject: Reply with quote

you can also read the IP_MASQUERADING HOW TO:

http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/index.html
Back to top
View user's profile Send private message
homeobocks
Guru
Guru


Joined: 19 Dec 2003
Posts: 345
Location: I'm from Canada, and they say I'm a little slow . . . eh?

PostPosted: Thu Feb 05, 2004 3:01 am    Post subject: Reply with quote

triwebb1 wrote:
It is called masquerading in linux. Do this on Greedo:
Code:
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

That will enable masquerading going out your external interface, and allow ip forwarding. This is NAT/PAT.


When I do the first command, I get this message:
Code:
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADEWarning: weird character in interface `-j' (No aliases, :, ! or *).
Bad argument `MASQUERADE'
Try `iptables -h' or 'iptables --help' for more information.


I also tried with SNAT, but with the same results (s/MASQUERADE/SNAT).
_________________
HOW DO I SHOT WEB
Back to top
View user's profile Send private message
aerandir
n00b
n00b


Joined: 09 Jan 2004
Posts: 13
Location: Denmark

PostPosted: Thu Feb 05, 2004 3:18 am    Post subject: Reply with quote

do you have masquarading (and other relevant netfilter parts) enabled in your kernel?

Code:
gauntlet:/usr/src/linux# grep MASQ .config
CONFIG_IP_NF_TARGET_MASQUERADE=m


I usually enable all netfilter stuff as modules and then load the ones I need..
Back to top
View user's profile Send private message
homeobocks
Guru
Guru


Joined: 19 Dec 2003
Posts: 345
Location: I'm from Canada, and they say I'm a little slow . . . eh?

PostPosted: Thu Feb 05, 2004 9:39 pm    Post subject: Reply with quote

aerandir wrote:
do you have masquarading (and other relevant netfilter parts) enabled in your kernel?

Code:
gauntlet:/usr/src/linux# grep MASQ .config
CONFIG_IP_NF_TARGET_MASQUERADE=m


I usually enable all netfilter stuff as modules and then load the ones I need..


Yeah, Knoppix 3.3 has masquarading in the kernel.
_________________
HOW DO I SHOT WEB
Back to top
View user's profile Send private message
homeobocks
Guru
Guru


Joined: 19 Dec 2003
Posts: 345
Location: I'm from Canada, and they say I'm a little slow . . . eh?

PostPosted: Fri Feb 06, 2004 7:40 pm    Post subject: Reply with quote

bump
_________________
HOW DO I SHOT WEB
Back to top
View user's profile Send private message
ClausH
n00b
n00b


Joined: 03 Aug 2003
Posts: 58
Location: Herning, denmark

PostPosted: Fri Feb 06, 2004 10:14 pm    Post subject: Reply with quote

homeobocks wrote:
triwebb1 wrote:
It is called masquerading in linux. Do this on Greedo:
Code:
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

That will enable masquerading going out your external interface, and allow ip forwarding. This is NAT/PAT.


When I do the first command, I get this message:
Code:
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADEWarning: weird character in interface `-j' (No aliases, :, ! or *).
Bad argument `MASQUERADE'
Try `iptables -h' or 'iptables --help' for more information.


I also tried with SNAT, but with the same results (s/MASQUERADE/SNAT).


Did you set $EXTIF to your external interface eg.

Code:

EXTIF=eth0


And if your default policies are not set do ACCEPT, you will need

Code:

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT


with $INTIF being the internal interface.

Mvh Claus Holmgaard
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