Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables+dhcpd help needed plz :S
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
zion1459
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2003
Posts: 146

PostPosted: Wed May 14, 2003 3:05 pm    Post subject: iptables+dhcpd help needed plz :S Reply with quote

Hi.

I'm trying to setup Internet sharing. here's my setup so far.

eth0: connected to the internet using dhcpcd.
eth1: IP: 192.168.0.1

I've installed dhcpd and it's giving all LAN computer connecting to eth1 an IP address.. this part works great.

I've also installed iptables and tried doing a:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

iptables works flawlessly but my windoze box can't get on the net.
the windoze box gets and IP as it should but no Internet. I wanted to make my internet sharing so that the client simply had to get their IP, dns, etc via dhcp and then Internet should work without proxy settings.. the typical "plugin the cable and u're online" setup...

what have I done wrong?

regards zion1459
Back to top
View user's profile Send private message
grooveman
Veteran
Veteran


Joined: 24 Feb 2003
Posts: 1217

PostPosted: Thu May 15, 2003 1:54 pm    Post subject: Reply with quote

Can your windows machine ping your linux machine? (and vice-versa).

Does your dhcp server pass along the dns server information to your windows box? Trying pinging an ip rather than a DNS name.

Are you sure that eth0 is the proper nic? This should be the one connected to the internet...

Have you double-checked to make sure your linux box has connectivity to the internet?

BTW -- I certainly hope you have some more rule sets in your iptables script to protect your network. If that is your only ruleset, then your are inviting trouble.


Sorry if some of these questions seem dumb, but it is best to start simple.

Anyway, I hope some of it was helpful.

Chris
_________________
To look without without looking within is like looking without without looking at all.
Back to top
View user's profile Send private message
krusty_ar
Guru
Guru


Joined: 03 Oct 2002
Posts: 560
Location: Rosario, Argentina

PostPosted: Thu May 15, 2003 2:16 pm    Post subject: Reply with quote

You need to set the default gateway via dhcp in your windoze, to check if you are already doing this, use winipcfg (win9x) or ipconfig (NT). you can set it manually in win9x via the network icon in the desktop at least in 9x.
_________________
I am Beta, don't expect correct behaviour from me.
Take part of the adopt an unaswered post initiative
Back to top
View user's profile Send private message
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Thu May 15, 2003 10:25 pm    Post subject: Reply with quote

My first question when anyone has this sort of problem:

Did you do a:

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

?
_________________
http://get.a.clue.de
Back to top
View user's profile Send private message
grooveman
Veteran
Veteran


Joined: 24 Feb 2003
Posts: 1217

PostPosted: Thu May 15, 2003 11:06 pm    Post subject: Reply with quote

Yeah... Good point splooge!
_________________
To look without without looking within is like looking without without looking at all.
Back to top
View user's profile Send private message
zion1459
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2003
Posts: 146

PostPosted: Fri May 16, 2003 1:54 pm    Post subject: Reply with quote

yea I've done the "echo "1" > ...."

I think the problem is with the dhcp server.. how do I get it to pass along the information from the dhcpcd which get the internet dns servers? or do I simply have to type the dns's in manually? (this would suck since my ISP sometimes changes the ip on the dns servers.. don't ask me why... )
Back to top
View user's profile Send private message
Buzzz
n00b
n00b


Joined: 17 Apr 2002
Posts: 63
Location: Enschede, The Netherlands

PostPosted: Sat May 17, 2003 8:49 pm    Post subject: Reply with quote

I would say, install dnsmasq and use your router in the rest of the network as dns server.
do a
emerge dnsmasq
/etc/init.d/dnsmasq start
rc-update add dnsmasq default

And add the following line to your /etc/dhcp/dhcpd.conf
option domain-name-servers 192.168.1.1;

dnsmasq automatically uses your /etc/resolv.conf to forward the dns requests to and also adds your /etc/hosts to the dns. Just perfect for your use i think
_________________
There are no stupid questions, but there are a lot of inquisitive idiots
Back to top
View user's profile Send private message
zion1459
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2003
Posts: 146

PostPosted: Sun May 18, 2003 11:29 am    Post subject: Reply with quote

Buzz: yea it did the trick :D j33t.. now I got Internet for my LAN :D

thx all :)

oh btw. grooveman said something about security... now if some1 would wanna mess with my system they would have to be on my LAN right? I mean, I don't wanna install a firewall then since I 0wn all the boxes on my LAN... right?
Back to top
View user's profile Send private message
x3m.seth
n00b
n00b


Joined: 15 Dec 2003
Posts: 3

PostPosted: Wed Dec 24, 2003 1:31 am    Post subject: Reply with quote

buzz or anyone... i'd realize this is an old topic, but everything goes well... from the other machine i do ping google.com and it resolves but seems can't reach the host.......
i guess it's something with my routing tables?? any help here???

my internet provider gave me a dynamic ip, and i have a network card on 192.168.0.1 wich i have installed gentoo and dnsmasq to be the dns resolver...
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