nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

iptables linux firewall laptop script for Airtel DSL

This is a discussion on iptables linux firewall laptop script for Airtel DSL within the Linux software forums, part of the Linux Getting Started category; Dear all, Finally I brought a new Dell lappy and installed Fedora Core Linux. My usage Download send email using ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Linux answers from nixCraft.


Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 13-12-2006, 10:14 PM
raj's Avatar
raj raj is offline
Senior Member
User
 
Join Date: Jun 2005
Location: Hyderabad
OS: Fedora, Debian Linux
Posts: 307
Thanks: 42
Thanked 8 Times in 8 Posts
Rep Power: 6
raj will become famous soon enough raj will become famous soon enough
Default iptables linux firewall laptop script for Airtel DSL

Dear all,

Finally I brought a new Dell lappy and installed Fedora Core Linux. My usage
Download send email using AIRTEL email server
Bittorent download
Browse internet
Chat using Yahoo messenger

I am connected to internet via Airtel Ethernet router. Please give me a shell script that protect my laptop from scum of the universe aka Internet

Regards,
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote
  #2 (permalink)  
Old 14-12-2006, 05:11 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Code:
#!/bin/bash
# Clean firewall
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
modprobe ip_conntrack
modprobe ip_conntrack_ftp

# Setting default filter policy, drop all incoming 
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT

# Unlimited access to loop back
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Allow UDP, DNS and Passive FTP
iptables -A INPUT -i $INET -m state --state ESTABLISHED,RELATED -j ACCEPT

#allow bittorent incoming client request :)
iptables -A INPUT -p tcp --destination-port 6881:6882 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 443 -j ACCEPT

# router request @ port 514
# iptables -A INPUT -p udp --destination-port 514 -j ACCEPT

#Uncomment below to allow sshd incoming client request
#iptables -A INPUT -p tcp --destination-port 22 -s IP -j ACCEPT

# DROP everything in case ;) and Log it
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
See Rocky's tutorial for more info http://www.cyberciti.biz/tips/how-do...onnection.html
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Firewall script addition request meowing Shell scripting 0 14-10-2007 05:00 AM
Redhat linux 4 / 5 disable iptables firewall chiku Networking, Firewalls and Security 0 27-04-2007 05:19 PM
Linux my laptop computer unable to power off when I shutdown cityblogger Linux software 1 05-07-2006 12:24 PM
Intel Centrino laptop Red Hat or Fedora Core Linux wireless tom Getting started tutorials 1 17-06-2006 01:50 PM
bittorrent firewall iptables Linux software 1 08-01-2006 12:58 AM


All times are GMT +5.5. The time now is 09:23 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38