LAN chain in iptables. Are there better approaches?

Hi all.
I'm a newbie in iptables and network security stuff. Would like to get an advice on a following problem.
I have a router with IP 192.168.1.1, my LAN contains bunch of wireless devices and desktop PC with a static IP *.2.
I want to enable certain services (ftp, sftp for local user, game servers, etc.) on my desktop PC to be accessible from any of my wireless devices.
Though, I don't want them to be accessible from the router, because I want to be safe just in case if router gets hacked (router has DDNS enabled and runs sshd for tunneling purposes).
It is not actually safety that bothers me a lot. I'm just trying to gain some understanding on topic, so I decided to make this particular setup.
I've read that Simple Stateful Firewall article on wiki and now I'm considering doing the following, but not sure, whether this is good approach:
# create chains
iptables -N LAN
iptables -N LAN_TCP
iptables -N LAN_UDP
# route all traffic from wireless devices to LAN chain
iptables -A INPUT -m iprange --src-range 192.168.1.3-192.168.1.255 -j LAN
# specific LAN chain rules
iptables -A LAN -p tcp --syn -m conntrack --ctstate NEW -j LAN_TCP
iptables -A LAN_TCP -p tcp --dport 22 -j ACCEPT
Is it worthwhile? Are there better approaches? I suspect, that if router gets hacked, hacker will be able to change its IP, so such rules won't work, will they?
Just thought, that perhaps restricting by routers mac would be a better approach. Though I've wrote a lot of text already... So, anyway, would like to get comments from forum members
Thanks in advance.

That should work, although don't forget to DROP or REJECT by default:
iptables -P INPUT DROP
iptables / netfilter is very flexible and you can achieve any given task a number of ways. There are generally no "right" and "wrong" ways, just best practices here and there.

Similar Messages

  • How best to save photos?  I want to protect my photos (15,000 of them) by putting them on a portable drive and storing it in my safety deposit box.  Is it better to export them all, drag the Photo file, use Time Machine – or are there better alternatives?

    I am a 'newby' to the discussion world.  Hope I am doing this right.  How best to save photos?  I want to protect my photos (15,000 of them) by putting themon a portable drive and storing it in my safety deposit box.  Is it better to export them all, dragthe Photo file, use Time Machine – or are there better alternatives?

    Welcome to the discussions! You can use Time Machine and I would also recommend for you to manually copy your iPhoto Library (on your Pictures folder) to an external drive/thumb drive so you can restore it from there should you loose your TM backup. Exporting them from iPhoto would not preserve the libraries' integrity neither your originals, should you choose to edit them in iPhoto.
    Regards.

  • I have an Iphone 4S.  I am unable to turn the volume on Maps and/or Mapquest high enough to hear.  Are there better (and louder) navigation programs?

    I cannot increase the volume of Maps or Mapquest on my Iphone 4S loug enough to hear it.  Are there better navigation apps or does anyone know how to make the volume louder?

    Anyone have any ideas?

  • PS3 + 24" LED - a solution, but are there better ones?

    Hi everyone,
    As you might have seen here is the best solution yet to the PS3 + Apple 24" LED Cinema Display Problem -
    http://www.cinemaview.com/models.html
    However, seeing as this is more an allrounder, are there any cheaper solutions that would be able to convert the PS3's HDMI signal for DisplayPort?
    There is a solution of 4 adaptors (HDMI to HDMI, HDMI female to DP, DP Female to DP Female, DP to MiniDP Female - then to 24"), but would this work without conversion of the signal?
    Are there any solutions that allow input of my PS3's 1080p's video signal into my mac and then out again through displayport? (Any EyeTV like products?)
    (BTW - sound would be handled by 5 speakers (coaxial Z-5500 Digital) so that is not a worry)
    I will be buying the display if any of this works.
    If not I will have to toss up,
    Apple 24" LED + convenience with my Mac + Z-5500 - compatability
    vs.
    HP L2475W + PS3 + Z-5500 + compatibility - convenience
    Difficult!

    I'll be a little more full in my response this time and see if your opinion changes.
    The PS3, at the moment, is being run on a Sony Bravia 46" 1080p LCD which to be honest is pretty magnificent.
    If I had the money and my dad would let me, I would be installing Z-5500s downstairs with the PS3, and upstairs in my room with the mac.
    The apple monitor, in my opinion, is my dream monitor. It is the one I would like, it is the one my dad is getting for his new mac tomorrow (Yes I am jealous), and it is the one I would be buying hands down if it had a DVI, HDMI, Component, or even VGA input.
    The hp monitor has the better versatility but from what I have read, the Apple is still the better display. You talk of speakers - no interest, but isight and mic are (adium messenger).
    The thought of having the use of 5.1 speakers + 1920x1080p + 24" + PS3 in my room is highly appealing.
    The thought of having the use of 5.1 speakers + 1920x1200 + 24" + APPLE LOGO + MacBook + Convenience and Tidyness is just as appealing.
    What would I be missing with the 24" ACD -
    - The PS3 wouldn't have surround 5.1
    What would I be missing with the 24" HP -
    - The Apple Logo
    - The convenience of tri-port power
    - Seamless integration between computer and monitor (just like a desktop)
    I can't say I use the PS3 more than 2-4 times a month. I use my computer every single day for at least 3-4hrs, often more.
    Is the Apple for me?

  • Alternatives and/or better approaches to multiple getParents?

    Hi,
    I'm working on a program wherein I have some child components in JPanel Forms (buttons for the most part) that need to access some components in the parent JFrame Form. I can do it with a bunch of chained getParents, but it is somewhat annoying to have to figure out how many getParents I need (for instance, I needed 5 for the last one).
    Is there an alternative to doing so many? Or, are there better ways to accomplish what I'm doing?
    Please let me know if anything needs to be further clarified.
    Thank you for your time!

    Pass a reference of the grand-grand-grand...parent to the child
    or make that reference globally accessible.

  • System fan error on g62-352ca on startup. are there two fans ie a cpu fan and a system fan?

    I get a system fan error on power up?     Are there two fans in the G52-352CA?   Ie a general system fan and a CPU cooling fan or just the one CPU/heatsink fan?
    If it is the CPU/heatsink fan then there are 4 part numbers for different options.   Is there some way to tell from the model number or features as to which is needed.    I would prefer to have the part in hand before opening everything up.    Are there better fans to buy and if so how do I find them?       This unit was always running a little on the warm/hot side,

    Hi,
    Could you add the error message to the next reply?
    ** Say thanks by clicking the "Thumb up" icon which is on the left. **
    ** Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue. **

  • What do I do with the Beta 10.9.3 program I've been using these past several weeks, now that 10.9.3 is out and downloaded.......I still have 'feedback assistant' in my dock........are there files I need to do something with ???  thanx

    What do I do with the Beta 10.9.3 program I've been using these past several weeks, now that 10.9.3 is out and downloaded.......I still have 'feedback assistant' in my dock........are there files I need to do something with ???  thanx..............75 yrs old and still swimmin' upstream.........

    from : OS X Beta Seed Program FAQ
    How do I get a shipping version of OS X back on my Mac?
    To get a shipping release of OS X on your Mac, you can simply install the final version of the software you are testing when it appears in Software Update.
    How do I leave the OS X Beta Seed Program?
    To leave the program, visit the Leave Program page and follow the instructions to remove your Apple ID and your computers from the OS X Beta Seed Program. This will stop pre-release updates from appearing in the Mac App Store on your computers.
    You only need to do more than you already have, if you'd rather not see future pre-release updates.

  • Are there any xml parsers better than xerces?

    hi, I need to find an efficient parser for my project. I am currently using the Xerces1.4.4 parser from Apache. Are there any xml parsers better than xerces? Do I need to change any code if I switch to a new parser?
    Thanks!!!

    I have not seen any comparisons but an XML parser (both sax and dom) now comes standard with java 1.4. You'll probably need to change your code but you won't have to ship Xerces with your app.

  • Is there a better approach to show the distinct count measures?

    Experts,
    I have a requirement in which I want to diplay 20+ calculated columns. The coulmns are something like this..
    No of clients with income < 10000 (to check against sales measure in fact table)
    No of Clients with sales > 500000 (to check against sales measure in fact table)
    No of clients whose join date > 1st jan current year ( to check against cust_start_dt of client Dim)
    No of clients with size "Medium" (to check agains a column client_size of Client Dim)
    No of clients with sell product units > 500 (Need to check units in PROD Dim)
    and so on..
    Well, I can write a case statement using expression builder for each column in the criteria, but the report performance is very bad. My client dimension is a huge partitioned table. As I keep on adding columns, the report takes more time to fetch data and at some point it never comes back.
    We tried to push to calculations to database, but since users can provide any selection criteria from dashboard prompt, it doesn't seem to work.
    If anyone had done any similar request in the past, please direct.

    Jared,
    Thank you for responding to my posted message. Rendezvous is a new concept to me, maybe
    it's the solution to my problem. I have been trying to read the on line manual and
    example VIs from National Instruments website. I still have a hard time to understand
    the concept.
    One of the example I saw is using rendezvous to run some sub VIs. But in my case, I have
    only one VI that is a while loop. Inside the while loop, there are a few tasks running
    simultaneously. I don't know whether it will serve my purpose.
    Guangde Wang
    Jared O'Mara wrote:
    > Guangde,
    >
    > Referring to your 2nd method, use rendezvous (under advanced>>synchronize
    > on function palette) to synchronize two processes. There are good examples
    > that come with labview. basically, you cre
    ate a rendezvous, giving it a
    > size. Using the wait on rendezvous vi, a function will not continue until
    > all rendezvous have reached that point. Using this method, you can synchronize
    > your 2 while loops.
    >
    > Jared
    >
    > Guangde Wang wrote:
    > >I tried two ways to control the tempo of my program.>>One is to use the
    > While Loop's counter and a wait. The drawback of this>method is the cycle
    > length is dependent on the measuring load. So if the>program runs for days,
    > it will be significent off the real time.>>The other way is to use the difference
    > of the Tick Count. It provides>accurate timing but the problem is the sychronization
    > of the clock cycle>and the While Loop cycle. I can try to put a little bit
    > wait but still>can not sychronize them very well. So after a while, there
    > will be two>measures get together.>>I don't know whether there are some better
    > ways to control the program>or whether we have some ways to improve either
    > or both of the above
    two>methods to make them work better. Please let me
    > know if you have any>suggestion.>>Thank you in advance,>>Guangde Wang>

  • Are there fonts that work better/worse with Chrome?

    My organization uses Trebuchet MS and it looks perfect when viewing our .pdf's in Safari, but does not look good in Chrome. Some of the lines are bolded for no reason. Is this a common problem and is there  better font to use?

    This is the .PDf in question:  http://www.waldronhr.com/images/stories/Position_Specifications/seattleaquarium_devdir.pdf
    It looks fine when viewed in Safari, but when viewed on Chrome, some of the white text looks bold (it shouldn’t) and other lines do not appear bold.
    Thanks for any suggestions!
    Jessica Crump, Director of Marketing and Communications
    [Personal info removed by moderator]

  • How to find out whether my Iphone 3Gs is officlially unlocked ( factory unlocked ) or "made" unlocked ? Can I upgrade its OS to OS 5 even if my phone is "made" unlocked ? how to up gared its OS ? are there any better ways to do it ?

    How to find out whether my Iphone 3Gs (OS version 3.1.3) is officlially unlocked ( factory unlocked ) or "made" unlocked ? Can I upgrade its current OS 3.1.3 to OS 5 even if my phone is not officlially unlocked ? how to up grade its OS ? what are there any better ways to do it ?
    Thanks,
    PRANAJ

    Depends wher you obtained the iPhone from and it's original supplier
    If the iPhone is an authorised unlock ( approved by the carrier) or was
    purchased from Apple as an unlocked iPhone  updating the iOS
    will have no effect on the iPhone and it's lock status
    HOWEVER if the software has been tampered with to remove the lock,
    updating the iOs will lock the iPhone back to the original carrier who holds the lock
    To find out the status of your iPhone  you could call Apple support
    and they may tell you if the iPhone is locked or not and if it is which carrier

  • I want to put my .m2ts movies (Sony HD recorder) on my Ipad3. It looks they need to be converted to h.264 format. Question is will Quicktime Pro work or are there any better software solutions. Running XP system. Thanks

    I want to put my .m2ts movies (Sony HD recorder) on my Ipad3. It looks they need to be converted to h.264 format. Question is will Quicktime Pro work or are there any better software solutions. Running XP system. Thanks

    You could try Handbrake, it works quite well.

  • Are there any other ext. soundcards better than SB Live! for recording?

    Hi everyone,
    About a year or so ago, I purchased the Soundblaster Live! 24-bit external
    I record from
    Guitar --> Amp--> SB Live! --> Adobe Audition
    The tones I get are decent I guess, but I have found that my tone gets stripped down from what I am hearing from the amp. The sound out of the amp will sound crisp, but once I record into audition and playback, it sounds very choppy and dry.
    My question is, is this the best or are there other ext. soundcards that can get me a better tone?
    Also, when I record, I plug into line-in in the soundcard, and in adobe, I select the soundcard and record from there. Are there any configurations I should try to see if I can get a better tone? Thanks everyone for your help.

    oldspice891 wrote:
    Alright great thanks, I will look into those.
    I am a noobie when it comes to cards sorry.
    How does my SB Live! compare to the X-Fi Elite Pro? That seems to be external, yet it also has the PCI card in which you would have to install it into the computer right? How does that work?
    And also how does my SB Live! compare to the Audigy 2 ZS?
    Thanks for the help.
    I am looking at the M-Audio Revolution 7.1 PCI Surround Recording Card from Musiciansfriend, it was the best rated. and I was wondering can I install that on a Dell Inspiron 9100 Laptop or do I need the card that is specialized for a laptop?Message Edited by oldspice891 on 09-02-2006 02:38 AM
    X-Fi Elite Pro is a PCI type soundcard w/ external I/O console so, you can't use it w/ a laptop. M-Audio Revolution cards, 5.1 and 7.1 are PCI type soundcards too (here are USB/FirewWire models listed). The only Creative SB Audigy 2 laptop models are Audigy 2 ZS Notebook (PCMCIA) and Audigy 2 ZS Video Editor (USB) and Audigy 2 NX (USB). You find technical information for those from Creative web. The Notebook model is the only from those that has ASIO support (other supports ASIO through WDM/KS wrappers (like USB-ASIO (~50US$) and Asio4All (freeware) drivers)
    W/ laptop you can use only USB, FireWire and CardBus/PCMCIA audio devices.
    There are not many CardBus/PCMCIA cards available, and the only low budget PCMCIA card is Audigy 2 ZS Notebook. E-MU has two excellent models 1616 and 1616M but the prices are much higher than Aydigy has. Other available CardBus/PCMCIA cards are ECHO Indigo (two models) and couple (expensive) Digigram models.
    As FireWire (IEEE1394) interface, there are models starting from around 100US$ (Behringer), but I would rather recommend devices around 300-450US$ (there are many excellent models w/ and/or w/o mic pre-amps, etc.). FireWire type devices are better from USB devices because of lower CPU consumption and faster throughput. Also w/ 3rd party drivers you can connect/use several FireWire audio devices simultaenously.
    An USB device is perhaps the cheapiest way to go. There are plenty of models available so you just need to place your requirements and find the one.
    Some review sites
    - http://www.soundonsound.com/search?u...23&Summary=Yes
    - http://www.soundonsound.com/search?u...45&Summary=Yes
    - http://www.soundonsound.com/search?u...46&Summary=Yes
    - http://www.musictechmag.co.uk/mtm/reviews
    - http://www.digit-life.com/sound.html?arch
    jutapa
    Message Edited by jutapa on 09-03-2006 10:06 PM

  • I am frequently unable to join the internet or it runs very slowly.  I have a Time Capsule in my LAN. Are there any compatibility issues with Time Capsules and any ISPs?

    I am frequently unable to join the internet or, if I can, it is exceptionally slow. The ISP says nothing is wrong ontheir end.  Are there any compatibility issues with any ISPs when using Time Capsule and/or iMacs?

    Tried this several times to no avail.  I believe it is the ISP causing the problem...Time Warner.

  • What's the better approach?

    Hi, I was just making a program that access a DB through JDBC, and I got myself into this dilemma
    What's the better approach to make a connection to a DB?
    approach #1(use of singleton pattern)
    import java.sql.*;
    public class DBConnection {
        private ResultSet rs;
        private Connection conn;
        private PreparedStatement ps;
        private static boolean singleton = false;
        private DBConnection() throws Exception{
            Class.forName("driverPath").newInstance();
         conn = DriverManager.getConnection("url", "user", "pass");
         singleton = true;
        public static DBConnection getInstance() throws Exception{
            if(singleton)
             return null;
            return new DBConnection();
        protected void finalize() throws Throwable {
            //close the connection and release resources...
            singleton = false;
        //Methods to make DB querys and stuff.     
    }approach #2 (make a connection only when doing querys)
    public class DBConnection {
        private ResultSet rs;
        private Connection conn;
        private PreparedStatement ps;
        public DBConnection() throws Exception {
            Class.forName("driverPath").newInstance();
        //Just some random method to access the DB
        public ArrayList<Row> selectAllFromTable() {
            ArrayList<Row> returnValue = new ArrayList<Row>();
         try {
             conn = DriverManager.getConnection("url", "user", "pass");
             //make querys and fill the arraylist with rows from the table
         } catch(Exception ex) {
             returnValue = null;
             ex.printStackTrace();
         } finally {
             if(ps != null)
                 ps.close();
                if(rs != null)
              rs.close();
             if(conn != null)
              conn.close();
         return returnValue;
    }I know this classes maybe don't even compile and I don't handle the Exceptions, I'm just trying to make a point about how to manage the connection
    So, what it's the better approach in your opinions? #1? #2? neither?

    Hi,
    I'm resurrecting this thread to ask is this approach OK?
    I'm trying to make a single MySql JDBC connection accessible throughout the model.
    I'm planning to use it in a Swing application. Whilst I realise the Swing apps are inherently multi-threaded, everything I plan to do can (I think) be done within the constraint that all access to model happens on the EDT, and the user will just have to wear any unresponsiveness.
    package datatable.utils;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    abstract public class MySqlConnection {
         public static final String URL = "jdbc:mysql://localhost/test";
         public static final String USERNAME = "keith";//case sensitive
         private static final String PASSWORD = "chewie00";//case sensitive
         private static final Connection theConnection;
         static {
              String driverClassName = "com.mysql.jdbc.Driver";
              try {
                   Class.forName(driverClassName);
                   theConnection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
              } catch (Exception e) {
                   throw new DAOException("Failed to register JDBC driver class \""+driverClassName+"\"", e);
         public static Connection get() {
              return(theConnection);
    }Is there a better solution short of c3po? Which I played with, but couldn't work out how to configure.
    Thanx guys (and uj),
    keith.

Maybe you are looking for