#1  
Old 15th September 2008, 16:50
chrno chrno is offline
Member
 
Join Date: Apr 2006
Posts: 70
Thanks: 0
Thanked 1 Time in 1 Post
Default iptables advice

My setup:

Vmware Host (eth0) --- iptables (NAT) --- Vmware GuestOS (vmnet1 :: 192.168.101.0/24)


My iptables config:

Code:
# Masquerade all traffic (allow NAT traffic through VM Guest)
# vmnet1		host-only network		192.168.101.0/255.255.255.0

iptables --table nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
iptables -A FORWARD --in-interface vmnet1 -j ACCEPT
iptables -A INPUT -i vmnet1 -s 192.168.101.0/24 -d $SERVER_IP -j ACCEPT

I would like to access SAMBA (this sits on the Vmware Host) from within Vmware GuestOS.
e.g. \\192.168.101.1\SAMBA


I'm at a lost at how to configure the iptables to grant this access from the Vmware GuestOS.

Any help or recommendations will be kindly appreciated.



chrno
Reply With Quote
Sponsored Links
  #2  
Old 16th September 2008, 18:19
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

You must open the ports 137 - 139.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 17th September 2008, 17:24
chrno chrno is offline
Member
 
Join Date: Apr 2006
Posts: 70
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

Awesome! All sorted ...

chrno

Code:
iptables -A INPUT -p udp -s 192.168.101.0/24 -d 192.168.101.1 --dport 137 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p udp -s 192.168.101.1  --sport 137 -d 192.168.101.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -A INPUT -p udp -s 192.168.101.0/24 -d 192.168.101.1 --dport 138 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p udp -s 192.168.101.1  --sport 138 -d 192.168.101.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -A INPUT -p tcp -s 192.168.101.0/24 -d 192.168.101.1 --dport 139 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp -s 192.168.101.1  --sport 139 -d 192.168.101.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -A INPUT -p tcp -s 192.168.101.0/24 -d 192.168.101.1 --dport 445 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp -s 192.168.101.1  --sport 445 -d 192.168.101.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables gateway with one lan adapter tsmr Installation/Configuration 1 7th August 2008 12:02
IPtables rule to let PPTP access LAN brianwebb01 Installation/Configuration 0 1st May 2008 21:23
Match IP with MAC using iptables for squid block cooljai Server Operation 0 30th August 2007 18:30
About iptables rules satimis Technical 0 24th August 2007 17:32
The Perfect Xen 3.0 Setup For Debian | IPTABLES rocket30 HOWTO-Related Questions 7 25th July 2006 14:18


All times are GMT +2. The time now is 09:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.