LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2009, 02:41 AM   #1
a2782d4
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Rep: Reputation: 0
iptables and SMB for one public address


I'm trying to config a public web server to SMB so my local windows users and hit the share. the server has a public address, I would like to say in the iptables to only accept traffic on the lan address..

I'm a bit lost I would i do that? Any help would be wonderful!


#SMB share
-A RH-Firewall-1-INPUT -p udp -m udp -s 64.451.207.181 --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp -d 64.451.207.181 --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -d 64.451.207.181 --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -d 64.451.207.181 --dport 445 -j ACCEPT
 
Old 05-03-2009, 06:58 PM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
Firstly, I am assuming your default iptables setting is to DROP packets that are not ACCEPTed by one of your rules. So, all you need to do is define rules that accept LAN traffic, and everything else will be dropped.

Also, I have assumed your lan traffic comes from ip range 192.168.0.x.
Code:
-A RH-Firewall-1-INPUT -m state --state NEW -s 192.168.0.0/24 -m udp -p udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -s 192.168.0.0/24 -m udp -p udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -s 192.168.0.0/24 -m tcp -p tcp --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -s 192.168.0.0/24 -m tcp -p tcp --dport 445 -j ACCEPT
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables forwarding to a second public IP address. Possible? dorthensensens Linux - Networking 6 08-21-2007 02:51 PM
I need an understanding of public IP address Mearth Linux - Networking 5 02-22-2007 08:45 PM
how to get public ip address openbysource Linux - Networking 1 02-22-2006 11:21 PM
public SMB directories thw Linux - Networking 2 03-24-2004 02:26 PM
freeswan and public address c0c0deuz Linux - Networking 0 08-13-2003 10:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration