LinuxQuestions.org
Review your favorite Linux distribution.
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 10-25-2001, 09:46 AM   #1
Sathe
Member
 
Registered: Sep 2001
Location: Bryan, Ohio USA (Home of the Etch-A Sketch)
Distribution: RedHat 7.1, 7.2, and 7.3
Posts: 76

Rep: Reputation: 15
ipchains masq


i have a server running redhat 7.1 up and running, and i am able to download things to my PC workstation just fine, but if i try to download something to my mac in IE i get a "PORT argument must be greater than 1025" error, i think its because the ftp link i am clicking on is seeing the 192.168.0.2 address rather than the real internet address of my server. i am using ipchains and this is all i have in it:
ipchains -P input ACCEPT
ipchains -P output ACCEPT
ipchains -P forward ACCEPT
ipchains -A forward -i ppp0 -j MASQ

what am i missing?
 
Old 10-25-2001, 02:44 PM   #2
adirotaru
Member
 
Registered: Sep 2001
Location: Romania, Timisoara
Distribution: Ubuntu 5.04
Posts: 49

Rep: Reputation: 15
firewall

Try to make a file called /etc/rc.d/init.d/firewall with following:

#!/bin/sh
inside=192.168.0.0/24
outside=outside_ip_here
anywhere="0.0.0.0/0"

OUTSIDE_IFACE=ppp0
INSIDE_IFACE=eth0

test -x /sbin/ipchains || exit 0

case "$1" in
start)
echo "Starting the firewall"

`echo 1 > /proc/sys/net/ipv4/ip_forward`
MOD="-A"

;;
stop)
echo "Stopping the firewall"

MOD="-D"

;;

*)
echo "Ussage: firewall start or firewall stop"
exit 1

esac

ipchains $MOD forward -s $inside -d ! $inside -j MASQ

ipchains $MOD input -j ACCEPT -i $OUTSIDE_IFACE -p TCP -s $inside ftp

ipchains $MOD input -j ACCEPT -i $OUTSIDE_IFACE -p TCP -s $inside ftp-data

ipchains $MOD input -j ACCEPT -i $OUTSIDE_IFACE -p ICMP -d $outside

ipchains $MOD input -j ACCEPT -i $INSIDE_IFACE -p ICMP -d $outside

ipchains $MOD input -j DENY -i $OUTSIDE_IFACE

ipchains $MOD output -p tcp -s $inside -d $anywhere ftp -t 0x01 0x10

ipchains $MOD output -p tcp -s $inside -d $anywhere ftp-data -t 0x01 0x08

ipchains $MOD output -p udp -s $inside -d $anywhere snmp -t 0x01 0x04

ipchains-save

CAUTION: ipchains and $inside or $ outside to be on the same line here I can't write on the same line. Every command ipchains on one line in that /etc/rc.d/init.d/firewall file .
The same problem with ipchains and 0x10 and others. I put a space between every line. Give execution permissions to that firewall file and then run it with root login.

Regards.
 
Old 10-25-2001, 02:47 PM   #3
adirotaru
Member
 
Registered: Sep 2001
Location: Romania, Timisoara
Distribution: Ubuntu 5.04
Posts: 49

Rep: Reputation: 15
Oh, it looks good.
Put that line in your file without CAUTION.

Be CAREFUL with that execution permision of firewall.
Run it and all will be ok , I think .

Regards.
 
  


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
linux masq server to linux masq server VPN rob_roman23 Linux - Networking 0 09-13-2003 09:54 AM
Ipchains masq and mirc dcc sends axis Linux - Networking 0 08-05-2003 11:31 AM
IP Masq nelse23 Linux - General 4 02-21-2003 07:57 PM
firewall script run at boot -> no masq, rerun manually -> masq worx Griffon26 Linux - Networking 2 06-24-2002 03:17 AM
IP Masq on RH 7.2 aceexpert Linux - Software 3 04-24-2002 05:07 AM

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

All times are GMT -5. The time now is 09:21 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