Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
simple iptables question
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
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 511

PostPosted: Fri Feb 14, 2003 8:45 pm    Post subject: simple iptables question Reply with quote

Ok this one is very simple an I'm almost ashame I don't have the answer myself, but there is so much other things in my head right now so if someone else can "release" this one for me :-)

I need to set up a simple iptables nat MASQ to give some vmware guestsinternet access. I know I can do this individually for each guest like
Code:
iptables -t nat -A POSTROUTING -s 192.168.0.27 -j MASQUERADE


but it's kinda tiresome to setup for each host and ip. How can I asign a table for the whole 192.168.0.0 network insted?. 192.168.0.0 don't work, neither seam 192.168.0 do...anyone?
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
Back to top
View user's profile Send private message
Larde
Guru
Guru


Joined: 07 Jun 2002
Posts: 313
Location: Duesseldorf, Germany

PostPosted: Fri Feb 14, 2003 8:56 pm    Post subject: Reply with quote

If I understand correctly, you are looking for 192.168.0.0/24, your example would be:
Code:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

If you'd need the whole 192.168.x.x network, you'd use 192.168.0.0/16.

Hth,
Larde.
_________________
Someday this will be my home... http://moonage.net/
I'll make you a deal
I'll say I came from Earth and my tongue is taped
Back to top
View user's profile Send private message
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 511

PostPosted: Fri Feb 14, 2003 9:31 pm    Post subject: Reply with quote

ahh thanks! I thought it was something with .0\nn but have never really understood that way of structuring the ip's - thanks again.
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
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