LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-11-2001, 04:45 PM   #1
RecoilUK
Member
 
Registered: Jul 2001
Location: Southampton, England
Distribution: Mandrake 8.2 , Slackware 8.1, $LFS
Posts: 270

Rep: Reputation: 30
Question IP TABLES setup


Hi guys, me again.

I,ve managed to setup my Apache webserver/PHP/MySql and the internet connection, which is a Alcatel USB modem with BTOpenworld and sharing this with another PC running Windows on my home LAN which has a staic IP.

I set it up with the ICS Connection Wizard in the Mandrake Control Centre and it works great, much faster than when its connected to windows. However I now want to make a new firewall script for better protection but dont want to use the Control Centre for this because I believe it will override my ICS scripts.

Am I correct in thinking that I can just modify the IP TABLES script for ICS to do this and does anybody know where the scripts are? and i,ve decided samba isnt what I need its time to setup ssh next, any tips?

Thx guys, any input would be most appreciated

ps- any idea why Mandrake installs both Ip tables and chains???

RecoilUK
 
Old 12-12-2001, 12:45 PM   #2
RecoilUK
Member
 
Registered: Jul 2001
Location: Southampton, England
Distribution: Mandrake 8.2 , Slackware 8.1, $LFS
Posts: 270

Original Poster
Rep: Reputation: 30
Help plz
 
Old 12-12-2001, 01:05 PM   #3
RecoilUK
Member
 
Registered: Jul 2001
Location: Southampton, England
Distribution: Mandrake 8.2 , Slackware 8.1, $LFS
Posts: 270

Original Poster
Rep: Reputation: 30
OK I think i,ve found the right file anyway, its called rc.firewall.inet_sharing-2.4 does this sound correct? because there are a few others in there aswell.

Anyway, below is what is in the file allready....

#!/bin/sh
# Load the NAT module (this pulls in all the others).
modprobe iptable_nat

# Turn on IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

# In the NAT table (-t nat), Append a rule (-A) after routing (POSTROUTING)
# which says to MASQUERADE the connection (-j MASQUERADE).
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

# Allows forwarding specifically to our LAN
/sbin/iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT

# Allow dhcp requests
/sbin/iptables -A INPUT -i eth0 -p udp --sport bootpc --dport bootps -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -p tcp --sport bootpc --dport bootps -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -p udp --sport bootps --dport bootpc -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -p tcp --sport bootps --dport bootpc -j ACCEPT

# Allow dns requests
/sbin/iptables -A INPUT -i eth0 -p udp --dport domain -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -p tcp --dport domain -j ACCEPT


I guess this isnt very secure is it, any tips?

Thx guys

RecoilUK
 
Old 12-13-2001, 03:04 AM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
That is the right place to put user rules.
The policies are not in the script you have.

To see all the rules and policies do

iptables -L

If you know the ip of a couple of your dns servers you could narrow that down to only allow them. Same with the dhcp server.
Instead of allowing anyone access to those ports.



theres a lot of security stuff in the security forum.
 
  


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
IP Tables help muru Linux - Security 3 09-27-2005 11:39 PM
Router Setup -IP Tables Masquerading bk_bharani Linux - Networking 5 07-22-2005 09:42 AM
Router Setup -IP Tables Masquerading zhex900 Linux - Networking 3 07-04-2005 05:06 AM
give routing tables setup for my network cranium2004 Linux - Networking 1 05-17-2005 10:16 AM
IP Tables setup help RecoilUK Linux - Networking 2 12-07-2001 08:17 AM

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

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