View previous topic :: View next topic |
Author |
Message |
homeobocks Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/230423472413369d3a640f.gif)
Joined: 19 Dec 2003 Posts: 345 Location: I'm from Canada, and they say I'm a little slow . . . eh?
|
Posted: Wed Feb 04, 2004 2:55 am Post subject: Sharing Internet Connection |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
homeobocks Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/230423472413369d3a640f.gif)
Joined: 19 Dec 2003 Posts: 345 Location: I'm from Canada, and they say I'm a little slow . . . eh?
|
Posted: Wed Feb 04, 2004 5:40 am Post subject: |
|
|
bump _________________ HOW DO I SHOT WEB |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
homeobocks Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/230423472413369d3a640f.gif)
Joined: 19 Dec 2003 Posts: 345 Location: I'm from Canada, and they say I'm a little slow . . . eh?
|
Posted: Wed Feb 04, 2004 7:35 pm Post subject: |
|
|
bump ![Evil or Very Mad :evil:](images/smiles/icon_evil.gif) _________________ HOW DO I SHOT WEB |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
triwebb1 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 19 Oct 2003 Posts: 87
|
Posted: Wed Feb 04, 2004 11:33 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
john7002 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1115763323422b822da1791.jpg)
Joined: 21 Jan 2004 Posts: 238 Location: United Kingdom
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
homeobocks Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/230423472413369d3a640f.gif)
Joined: 19 Dec 2003 Posts: 345 Location: I'm from Canada, and they say I'm a little slow . . . eh?
|
Posted: Thu Feb 05, 2004 3:01 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
aerandir n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 09 Jan 2004 Posts: 13 Location: Denmark
|
Posted: Thu Feb 05, 2004 3:18 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
homeobocks Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/230423472413369d3a640f.gif)
Joined: 19 Dec 2003 Posts: 345 Location: I'm from Canada, and they say I'm a little slow . . . eh?
|
Posted: Thu Feb 05, 2004 9:39 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
homeobocks Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/230423472413369d3a640f.gif)
Joined: 19 Dec 2003 Posts: 345 Location: I'm from Canada, and they say I'm a little slow . . . eh?
|
Posted: Fri Feb 06, 2004 7:40 pm Post subject: |
|
|
bump _________________ HOW DO I SHOT WEB |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ClausH n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Aug 2003 Posts: 58 Location: Herning, denmark
|
Posted: Fri Feb 06, 2004 10:14 pm Post subject: |
|
|
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.
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 |
|
![](templates/gentoo/images/spacer.gif) |
|