[SOLVED] Easy iptables setup to begin with...

Hello!
I'd like to write quick & easy iptables.rules that only just work for now until I've got time to get into the "more advanced basics".  I took a look at the "Simple stateful firewall Howto and what I need now is to reenable  everything that does not work any more (Samba, ssh etc.).
- Is there some easy way to take a look at what's blocked while I try out all programs that use the network one after another so I can add "ACCEPT"-lines with the corresponding ports by copying the howto's ACCEPT - lines and replacing the ports?
- I can't figure out a "rule" to let everything inside the private network trough... something like "-A -i wlan0 something 192.*" ...
So... I really have to much to figure out at once at the moment. Is there a way to do this stuff really fast without knowing the basics for now or is it in general safe enough to just remove iptables again until I've got time to read me trough how it works in detail?
Last edited by whoops (2009-03-30 14:52:42)

Combining with what fukawi2 said, I think this would be a good start for you. Sorry that it isn't formatted very well.
iptables -P INPUT DROP
# set default policy on the INPUT chain to drop
iptables -P FORWARD DROP
# set default policy on the FORWARD chain to drop
iptables -N LOG_REJECT
iptables -A LOG_REJECT -j LOG --log-prefix "[IPTABLES REJECT] : " --log-tcp-options --log-ip-options
iptables -A LOG_REJECT -j REJECT
iptables -A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP
# make sure new connections are SYN packets
iptables -A INPUT -f -j DROP
# drops all fragmented packets
iptables -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j DROP
# drop packets for xmas attack
iptables -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
# drops packets for null attack
iptables -A INPUT -i lo -j ACCEPT
# accepts traffic on the loopback interface
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# allows connections that originated with your machine
iptables -A INPUT -i wlan0 -s 192.168.0.0/24 -j ACCEPT
# allows local network
iptables -A INPUT -p tcp --syn -m state --state NEW --dport 22 -j ACCEPT
# this allows ssh, you can allow any other service the same way, for a span of ports, portnumber:portnumber should work, like 5000:5009
iptables -A INPUT -j LOG_REJECT
# any traffic that doesn't match a rule above is sent to the LOG_REJECT chain which is set to drop all packets sent to it and to add [IPTABLES REJECT] in the log file.

Similar Messages

  • How to I get the iPad to recognize a number beginning with 0 without it cutting off the 0

    How do I get the iPad to recognize a number beginning with 0 without dropping the 0.  And how do I get the iPad to recognize a 4 (birth year) or 5 (zip code) digit number with adding a comma delineating it to thousands?

    Hi,
    Because the iPad requires more power than from a normal USB port can supply therefore you can not charge an iPad using ONE USB port on a laptop/PC.  Please try this free utility, many HP users say it works:
       http://event.asus.com/mb/2010/ai_charger/
    Regards, 
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • What is a file that begins with ._  ?

    A client just sent me some files that begin with ._ in the extension.
    (Client claimed they are vector files for a video project)
    I tried to download and Mac told me they are system files and will be hidden.
    sure enough they didn't show up my desktop. I download again adding a " to the front of the extension. I got the file on my desktop- but it would not open.
    I trashed it.
    I then did a spotlight system search for the ._ files I think I download and I got no result.
    I'm now worried.
    Are these ._ somewhere on my system?
    Can they do harm to the system?

    In Unix the initial period in a filename causes the file to become invisible. Spotlight's default configuration will not locate invisible files. If the files are downloaded to your Downloads folder or to your Desktop then you can make them visible in a number of different ways.
    1. Enable Finder to Show Invisible Files and Folders
    Open the Terminal application in your Utilities folder. At the prompt enter or paste the following command line then press RETURN.
    defaults write com.apple.finder AppleShowAllFiles TRUE
    To turn off the display of invisible files and folders enter or paste the following command line and press RETURN.
    defaults write com.apple.finder AppleShowAllFiles FALSE
    Alternatively you can use one of the numerous third-party utilities such as TinkerTool or ShowHideInvisibleFiles - VersionTracker or MacUpdate.
    2. Open the Terminal application in your Utilities folder. At the prompt enter the following commands pressing RETURN after each. I will assume for the purpose of illustration that you have downloaded the files to your Desktop.
    cd /Users/yourusername/Desktop
    mv ._filename.ext filename.ext
    This will rename each file to the same filename but without the initial "._". Repeat the "mv" command for each file substituting the actual filename.ext for the "filename.ext" in the command line. If you have downloaded the files to a different location, then substitute the full path to that location in the "cd" command line.
    3. Download a utility such as Batch Rename'Em from CNet Downloads or MacUpdate and use it to mass rename the files by removing the initial "._".
    4. Have your client rename the files before sending them to you by explaining that they are invisible on the Mac with the initial period in the filename.
    5. Configure Spotlight to search in system folders and to display invisible files in search results.
    6. Download Easy Find - CNet Downloads or MacUpdate - and use it instead of Spotlight.
    Message was edited by: Kappy

  • PO PDF Error - File does not Begin with '%PDF-'

    Hi,
    I am working on Implementing PO PDF with XML data and RTF Template. I have created a new template in XML Publisher and followed the following set up steps
    Setup / Organizations / Purchasing Options / Control TAB / set 'PO Output Format' = 'PDF'
    setup / purchasing / document types / select "Standard Purchase Order" / Set the Document Type Layout to your new template.
    When I view the document from PO Summary > inquire > View Document, I get an adobe reader error
    'File does not begin with '%PDF-', how ever when I preview it from the template definition, it opens fine.
    I tried running PO Output for communication with my custom template but I don't see the parameter 'Purchase Order Layout'. The last parameter in the list is 'Include Blanket'.
    Am I missing any set up steps? However when I use the standard Purchase Order Layout in Document Types set up, the Inquire > View Document created a PDF output.
    Any help is greatly appreciated.
    Thanks,
    Sharmila

    I encountered same error in BPA Invoice Print. I remove a MLS function from the program definition and this error disappeared. Have not fully investigated but maybe this will help. Thanks.

  • @count for first names beginning with "

    I was trying to come up with a formula for counting club members and partners by using an "&" in front of the first name of partners. I could not find a conditional function whereby I could count the names that begin with the "&". I used trial and error with various count functions on strings with if thens, etc. I either end up with syntax errors or a null. Not that important but I like solving puzzles and may find a use for the concept with other strings in the future. Bottom line is: I would like to pick out a unique character at the beginning of different strings and count it (numerically) if is there (true).

    Here's an alternative that is similar to Jerry's, but allows placing the ampersand in a more logical location in the Name column entries. The yellow-filled column (Flag) may be hidden.
    Column B: Entered data (names), with an ampersand used to join names of partners where applicable.
    Column C (Flag) contains a formula that places a null string in rows where there is no entry in the column B (Name), zero in rows where the names entry does not contain an ampersand, and a number larger than zero corresponding to the position of the ampersand in rows where the Names entry has one.
    C2, and filled down: =IF(LEN(B)>0,IFERROR(FIND("&",B),0),"")
    Cells D2 and E2 contain similar formulas to count the two-name (partner) entries and the single name entries, using the flags set in column C.
    D2: =COUNTIF(C,">0")
    E2: =COUNTIF(C,"=0")
    Regards,
    Barry

  • This is an easy one: One Apple TV with two Account (MusicMatch and PhotoStream)

    Hi,
    How can I setup Apple TV with my iTunes Account (for music, movies, etc) and a different iCloud account for Photostream. This is easy in IOS and OS devices, but I could not figure this out on Apple TV. Apple TV configuration takes the iTunes account and uses it as the default for music match and Photostream, can this be different?
    If not how can I merge the two with least hassle.
    Thanks.

    That isn't correct, when you go to setup photo stream, it asks you if you wish to use the account associated with the iTunes store, or use a different one.

  • CFUPDATE problem with field name beginning with a number

    I have a form (actually several) that is gathering data for a survey. I tried to use cfupdate to update the data elements and got a string index out of range error. I tested again without the form fields that began with numbers and it worked just fine. I then tried to enclose the offending field names in () and []. Both times I got same error. Does anyone have a work around for this? The code and error are below.
    Changing the field names is not really an option. This survey has almost 400 data points and most of the fields begin with the question number.
    Thanks
    DW
    <cfupdate datasource="#application.fdp_datasource#" tablename="arra_survey1" dbtype="ODBC" formfields = "entry_no, 2_a_fy09, '2_a_fy10', '2_a_fy11', '2_a_fy12', '2_b_fy09', '2_b_fy10', '2_b_fy11', '2_b_fy12', '2_c_fy09', '2_c_fy10', '2_c_fy11', '2_c_fy12', '2_d_fy09', '2_d_fy10', '2_d_fy11', '2_d_fy12', '2_e_fy09', '2_e_fy10', '2_e_fy11', '2_e_fy12', '2_f_fy09', '2_f_fy10', '2_f_fy11', '2_f_fy12', '2_g_fy09', '2_g_fy10', '2_g_fy11', '2_g_fy12', '2_h_fy09', '2_h_fy10', '2_h_fy11', '2_h_fy12', '2_i_fy09', '2_i_fy10', '2_i_fy11', '2_i_fy12', '2_j_fy09', '2_j_fy10', '2_j_fy11', '2_j_fy12', '2_k_fy09', '2_k_fy10', '2_k_fy11', '2_k_fy12', '2_l_fy09', '2_l_fy10', '2_l_fy11', '2_l_fy12', central_office, dept_office, incl_other, 3_a_fy09, 3_a_fy10, 3_a_fy11, 3_a_fy12, 3_b_fy09, 3_b_fy10, 3_b_fy11, 3_b_fy12, 3_c_fy09, 3_c_fy10, 3_c_fy11, 3_c_fy12, 3_d_fy09, 3_d_fy10 3_d_fy11, 3_d_fy12, 3_e_fy09, 3_e_fy10, 3_e_fy11, 3_e_fy12, 3_f_fy09, 3_f_fy10, 3_f_fy11, 3_f_fy12, 3_g_fy09, 3_g_fy10, 3_g_fy11, 3_g_fy12, 3_h_fy09, 3_h_fy10, 3_h_fy11, 3_h_fy12, 3_i_fy09, 3_i_fy10, 3_i_fy11, 3_i_fy12, 3_j_fy09, 3_j_fy10, 3_j_fy11, 3_j_fy12, 3_k_fy09, 3_k_fy10, 3_k_fy11, 3_k_fy12, 3_l_fy09, 3_l_fy10, 3_l_fy11, 3_l_fy12">
    String index out of range: -2
    The error occurred in C:\Inetpub\wwwroot\directory\process_arra_suvey_2.cfm: line 12
    12 : <cfupdate datasource="#application.fdp_datasource#" tablename="arra_survey1" dbtype="ODBC" formfields = "entry_no, 2_a_fy09, '2_a_fy10', '2_a_fy11', ...

    I think you have run one of CFUPDATE's limitations.  I am not 100% certain, but I do not think cfupdate provides a way to escape invalid column names like yours.  In which case you may need to do a regular UPDATE within a  cfquery instead... or rename your columns.
    fields that began with numbers
    Most databases discourage creating column names that start with a number (or other restricted characters).  While many databases will allow you to escape invalid names, it is simpler all around to avoid them altogether.  Otherwise, you may have to escape the names in every single query. The recommendations vary, but usually object names that begin with a  letter, and contain only letters, numbers and underscores are considered  safe.
    This survey has almost 400 data points and most of the fields begin with the question number.
    Four-hundred (400) is a lot of columns for a single table.  The fact that they all them seem to contain the same type of information (ie response to a question) is an indication that data should probably be stored in a separate table, as rows, not columns.  For example questions could be stored in one table, possible answers in another, and the results of an individual test/survey stored in a third table.  A structure like that is much easier to query, can easily accommodate changes (add/remove questions, responses, etcetera) without having modify the table every time.

  • How to setup a group with autentication

    Hi, Every body,
    I am new in this forum, I found Stratus is a so exciting platform, now I need your help.
    I want to setup a group with posting autentication, in the group, some one has the posting right, others have not. I found the "groupspecWithAuthentication, groupspecWithoutAuthentication,  encodePostingAuthorization,setPostingPassword" etc. but I cant understand how to use them.
    I have dived in this forum and the reference of Stratus 2.0 beta( here) for several days, and I have tried the samples posted by Mike, and I have study almost all threads in this forum, but I still cant find the clue.
    Please help me out, thanks advanced,

    Thank you, Mike, for your timely reply. Forgive me the delay, because now is our most important festival, I just back from a party.
    Now I understand, but I still wonder,
    1. if a group is in running, and a authorized user has joined. Now he misdoes, I want to withdraw the authentication, how can I? revise the password and recreate the group?
    2. How can I setup a group, just authorized users can join? I know I can use secret group name, but if authorized user divulge the group name, others without autentication can join the group too. ( because the swf easy to reverse, hacker can sniff the opaque groupspec string, revise the swf, impersonate authorized user, etc).
    3. How can I banishment a misdoer from my group?
    Thanks again for your time.

  • Can't 1 touch transfer to extensions beginning with *

    We have the 500S expansion cards and can't transfer to any extension beginning with *.
    So if we want to 1 touch transfer to a parking lot at *3103 we have to press bxfer and then the blf key..
    Wouldn't it be simpler to just enable this function to allow us to 1 touch transfer to extensions beginning with *?
    This also keeps us from 1 touch transfering directly to someones voicemail, queues, and other feature codes.
    This is affecting Asterisk and Freeswitch.

    For 1 customer??
    What about for millions of customers that use asterisk and freeswitch?
    I don't know why you guys haven't received more feedback on this topic.. I would have thought this is something that would make life easier for people and I can't understand why someone would want to NOT be able to 1 touch transfer to *.
    They must have paid alot of money to get this feature turned around because it doesn't seem like a normal bug/feature request.
    It's almost like saying, "Hey can you make it so that when I hit the blf for extensions over 4 digits in length, put the active call on hold before dialing the extension."
    Is this something that cisco will move on ever?

  • Setup Sunray 3G with Cisco 3005 VPN concentrator

    hi,
    I first explain the setup situation:
    Gobi8 (3G) => Cisco 3005 VPN Concentrator => Sunray Server (4 09/07)
    Do i need to setup a sunray segment for not-directly connected networks or do i need to setup one for directly connected networks?
    can the Sunray server gives IP-addresses to the Gobi8 trough a VPN-tunnel or do i need to let the Cisco handle the IP-address management?
    Is there some info about what IKE proposal i need to select in the Cisco 3005?
    Any help would be appreciated
    Thx

    I have not used the Gobi 8 but this is how I configure my SR 2, SR 2FS, and SR 270 for VPN, I believe the Gobi can do similiar things. You will need to setup your SR server as part of a shared network, NOT a dedicated network. Configure your concentrator as an Easy VPN server and the Gobi as an Easy VPN client. Using the Easy VPN setup automatically handles IKE though you will have to setup groups etc. Since my DTUs move around I use DHCP so the initial IP address comes from the local network, as part of connecting to the remote network the concentrator will issue an IP address for SR server network. This has worked for me on wired and WiFi LANs, I do not know if it will work with 3G wireless but I do not see why it should not. Hope this helps and good luck.

  • [solved]*boob*ed up my menu with menumaker - how do I restore?

    I just tried out menumaker and had a bit of a glitch when I simply allowed it to overwrite my old menu file with -f before making a backup.
    As luck would have it, I have the new menu structure, the programs that came up were hardly interesting and I just want to go back to my now deleted configuration.
    Is there any way to make xfce overwrite menumaker's new configuration?
    edit: Solved. As simple as removing the menu file generated by menumaker.:D
    Last edited by b9anders (2007-12-14 12:20:25)

    If you have the computer that you first setup the phone with iTunes then just connect the phone to that computer via. the USB cable and see if a sync can be done.

  • Error from reports from ZAM(Graph or PDF) - File does not begin with '%PDF-'.

    I just noticed today that any Graph or PDF report I try to view I get the
    following error - Error from reports from ZAM - File does not begin with
    '%PDF-'. I tried to just save the file and then open it, but get the same
    error. I can open other pdf files I have downloaded from other sites ok.
    Anyone have any idea? I haven't done anything to that server that I am
    aware of in quite a while.
    Thanks
    Bill

    I took a closer look at the files it downloaded, opened them with notepad,
    haer is what it says:
    XSL Transform or subsequent processing failedThe document has no pages.
    "Bill" <[email protected]> wrote in message
    news:2bBtk.2164$[email protected]..
    >I just noticed today that any Graph or PDF report I try to view I get the
    >following error - Error from reports from ZAM - File does not begin with
    >'%PDF-'. I tried to just save the file and then open it, but get the same
    >error. I can open other pdf files I have downloaded from other sites ok.
    >Anyone have any idea? I haven't done anything to that server that I am
    >aware of in quite a while.
    >
    > Thanks
    >
    > Bill
    >

  • Error : (does not begin with '%PDF-'. ) when print report in pdf

    Hi all,
    http://www.oracle.com/technology/obe/apex/apex31nf/apex31rpt.htm
    using the example in the above link,
    I have created a report and tried to print in pdf format,
    But
    does not begin with '%PDF-'. this error is appearing when the adobe reader is opening.
    Could anyone help me to make out the reason for this error?
    bye
    srikavi

    Srikavi,
    Which rendering engine are you using? BI Publisher? Apache FOP? Did you follow the steps outlined here when you configured PDF printing:
    http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html
    Regards,
    Marc

  • Safari won't open a file for mactree download manager beginning with "gto

    I am trying to download gametree mac download manager and the page will not open because it states it cannot open links that begin with "gto:"

    Seems the software is not fully compatible with Mountain Lion >  https://gametreemac.com/help/

  • HT1937 i unlocked my iphone 4 factory and i upgrade to 6.1 when i connect it to itunes it apears  The SIM card inserted in this iPhone does not appear to be supported This iPhone is not currently setup to work with carrier you're attempting to use. Please

    i unlocked my iphone 4 factory and i upgrade to 6.1 when i connect it to itunes it apears
    The SIM card inserted in this iPhone does not appear to be supported
    This iPhone is not currently setup to work with carrier you're attempting to use. Please insert another SIM card from a supported carrier or request that this iPhone be unlocked.

    It sounds like you or someone else hacked the phone to unlock it. Updating it locked it to the original carrier.
    How did you unlock it? The ONLY legitimate way is to ask the carrier it is locked to to unlock it. Any other way requires hacking or jailbreaking the phone.

Maybe you are looking for

  • Faulty Devices - Blackberry Z10

    Our company recently renewed the corporate mobile phone contract with Maxis and we received Blackberry Z10 Smart Phones as free device for the plan that we signed up. We received 58 units of Blackberry Z10 in June 2014, out of which to-date, several

  • Logitech Marble Mouse scrollwheel emulation

    Before I open a Wiki account*, can anyone else confirm that it only works over USB? I can't remember how long I've had this thing, and I even have a vague feeling I came up against this problem before I installed Arch, but I always assumed I must hav

  • Newsletter in email

    I'm using Pages Newsletter templates  I wanted to email the newsletters to my mailing list and have the newsletter show up with out having to save it as a PDF, and then the recipient download it.  SO, in other words how can I have the document displa

  • Transfering music from a Windows formatted ipod to a Mac - is it possible?

    I have a bit of an interesting problem. All my life I've used Macs, occasionally a PC, but I definitely prefer Macs. Anyhow, I currently have a PC, temporarially, I will be getting an iBook late Spring this year, and I have two iPods, a 4G formatted

  • New X-Fi Driv

    Is it just me, or a Creatve's Driver Development team taking the p!ss? After looking through the forums for quite some time now, I have seen many threads relating to the same thing, yet all you get in reply from the CL mod's is either: It's on it's w