Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Internet sharing with iptables & DHCP
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
Spydog
n00b
n00b


Joined: 15 Aug 2002
Posts: 9
Location: Eindhoven, NL

PostPosted: Thu Aug 15, 2002 2:55 pm    Post subject: Internet sharing with iptables & DHCP Reply with quote

Hi,

I'm quite new with linux and I want my Gentoo box to share my internet connection. The networking part is up (eth1 (module 3c59x) can connect to the internet, eth0 (module 8139too) has an own ip adress and is working). I want the rest of the computers to get an dynamic IP adress from the server by DHCP.

Is there a howto for how to do this on a gentoo box (latest version)?

The information I need is what there has to be enabled in the kernel, and what kind of programs I need etc (e.g. IPTABLES, DHCP etc).

I've already found this information on how to forward all packages (if I'm not mistaken):

Code:

HOWTO - Make your Internet Connection Sharing to work

From ISP to GENTOO - (eth0:DHCP or STATIC IP)
From GENTOO to WINDOWS - (eth1:192.168.0.1)

1.
insmod your.nic.module (i.e. "insmod 3c59x") for both nics if differ

2.
if your ISP uses DHCP, "dhcpcd eth0"
if static, "ifconfig eth0 your.static.ip netmask 255.255.255.0 gateway your.isp.gateway"



Now is time to configure the connection sharing
this is just for kenels greater than 2.4.x with iptables

1.
insmod iptables_nat

2.
echo 1 >/proc/sys/net/ipv4/ip_forward

3.
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
(if your linux uses eth0 to connect your isp)

4.
In the Windows Machine:

192.168.0.1 in the gateway
numbers from your /etc/resolv.conf in DNS server


I already emerged DHCP and IPTABLES, what do I need to do more to make this combination work? And ofcourse this setup must be used on every reboot of the server :)

I have tried to use the search, but didn't found much useful (or did I use it wrongly ;) ?

Thanks in advance.
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Thu Aug 15, 2002 3:18 pm    Post subject: Reply with quote

You need to enable iptables in the kernel. I don't believe it is as such by default. Then you'll have to recompile and reinstall your kernel.

I believe there are other posts with regards to this. Otherwise search on the web. If I find something I'll post it. I just did this Monday for the gentoo gateway/firewall I'm building.
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