nixCraft Linux Forum

nixCraft

Linux 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

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 12-13-2006, 11:14 PM
raj raj is offline
Contributors
User
 
Join Date: Jun 2005
Location: Hyderabad
Posts: 151
Rep Power: 4
raj is on a distinguished road
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
Sponsored Links
  #2 (permalink)  
Old 12-14-2006, 06:11 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
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 | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


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 On

Similar Threads

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


All times are GMT +5.5. The time now is 09:10 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

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