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-08-2005, 08:01 AM   #1
intuxicator
LQ Newbie
 
Registered: Jun 2004
Distribution: Fedora Core 4
Posts: 28

Rep: Reputation: 15
ipmasq and apache


i have an ipmasq script which works pretty fine but what bugs me is that, that it rejects packages from samba, ssh and apache port. So my questions is how can i enable those ports ? Btw.this is my rc.ipmasq script

Quote:
#!/bin/sh

IPTABLES=/sbin/iptables

#All The lines below are NAT routing

# flush any old rules
$IPTABLES -F
$IPTABLES -F -t nat
$IPTABLES -t mangle -F

# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o ppp0 -j MASQUERADE

# enable IP forwarding (of incoming packets)
echo 1 > /proc/sys/net/ipv4/ip_forward

$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -m state --state NEW -i ! ppp0 -j ACCEPT
$IPTABLES -P INPUT DROP #only if the first two are succesful
$IPTABLES -A FORWARD -i ppp0 -o ppp0 -j REJECT
big thanx in advance!

Last edited by intuxicator; 04-08-2005 at 08:04 AM.
 
Old 04-09-2005, 07:51 PM   #2
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
Here is a sample;
Forward port 2 to ssh on an internal host
# iptables -t nat -A PREROUTING -p tcp --dport 2 -i eth1 -j DNAT --to 192.168.0.2:22

FTP forwarding to an internal host
# iptables -t nat -A PREROUTING -p tcp --dport 21 -i eth1 -j DNAT --to 192.168.0.56

HTTP forwarding to an internal host
# iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth1 -j DNAT --to 192.168.0.56

That said I go the easy way and use firestarter.
 
  


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
dhcp and ipmasq AcidAlpha Linux - Networking 0 11-09-2005 03:40 PM
rc.ipmasq issues Sabicas Linux - Networking 1 12-29-2004 12:10 PM
ipmasq anywhere? Gilion Linux - Networking 0 10-16-2003 03:59 AM
SAMBA + IPMasq = ???? green_dragon37 Linux - General 1 04-30-2003 02:19 PM
need help with ipmasq/iptables vital Linux - Networking 4 07-02-2001 10:47 AM

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

All times are GMT -5. The time now is 01:16 PM.

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