/srv/irclogs.ubuntu.com/2013/03/15/#ubuntu-ca.txt

=== jlamothe is now known as Guest60057
=== Guest60057 is now known as jlamothe
willwhhey guys :)18:18
willwhanyone alive? could use a hand to talk something through :)18:18
willwhI have a VPS that is running iptables18:18
willwhI think my host are idiots and something is misconfigured18:19
willwhlet me save my iptables rules and I'll link em, 2min18:19
willwhhttp://willwh.com/iptables.txt18:21
willwhso my port 80 traffic == np18:21
willwhthe app I have bound to 3000 is not accessable remotely18:21
willwhI can hit it like so; lynx localhost:300018:21
willwhont he host18:21
willwhcan't connect externally18:21
willwhiptables looks good to me18:22
willwhand I think my host has something misconfigured18:22
willwhthey want me to pay them to investigate further (hah)18:22
willwhbut they are slow / poor in response18:22
willwhso18:22
DarwinSurvivorwillwh: do you have a copy of the actual iptables rules file (or script/etc)?18:27
willwhDarwinSurvivor: I think I figured it out18:28
willwhmy host are just being cheeky bastards18:28
DarwinSurvivorwillwh: double firewalled you?18:28
willwhno18:31
willwhthey're telling me "INPUT" chain18:31
willwhif you look at that iptables output18:31
willwhit's PUB_IN18:31
DarwinSurvivorI would recommend moving your ESTABLISHED line to the top, then blocking all non-syn tcp packets immediately after. that will drastically cut down on the amount of illegitimate traffic that hits your server18:31
willwhthat rules should be added to18:31
willwhah18:31
willwhDarwinSurvivor: I'm a little confused still though18:32
willwhI am not sure how I ended up with so many chains18:32
willwhand the fact that adding stuff to INPUT was useless18:33
willwhI'm not making a lot of sense, hag18:33
willwhhah*18:33
willwhbut trying to understand how a chain is applied18:33
DarwinSurvivorline 14 is useless as line 13 will prevent ANYTHING from getting to it18:33
willwhyes18:34
willwhbut like I say - the INPUT chain rules seem to have almost no effect18:34
willwhit's all the PUB_IN18:34
DarwinSurvivorand you don't need a drop rule at the end of INPUT if your default policy is to drop18:34
DarwinSurvivorhmm18:34
DarwinSurvivoryeah, i see that18:34
willwhI don't understand the difference18:34
willwhor how they relate at all18:34
DarwinSurvivordo you know which network adapter is your external?18:35
DarwinSurvivorif it's anything but eth0, then 3 will not trigger and it will get blocked in PUB_IN18:35
DarwinSurvivor*rule 318:35
willwhyou mean rule 3 in INPUT?18:35
DarwinSurvivoryes18:36
willwhahhh18:36
DarwinSurvivorif your external connections are not coming in through eth0, that rule will not work18:36
willwhright18:36
willwheurka18:36
willwhI understand18:36
willwh:)18:36
DarwinSurvivorifconfig should tell you which ones you have18:36
willwhyup18:36
willwhthanks mate18:36
DarwinSurvivorno problem18:36
willwhlo and 2 virtual interfaces18:36
willwhso that kinda explains that ;]18:36
DarwinSurvivorbingo18:36
DarwinSurvivorwhen I saw all the FOO+, I figured you had a non-standard setup18:38
willwhDarwinSurvivor> I would recommend moving your ESTABLISHED line to the top, then blocking all non-syn tcp packets immediately after. that will drastically cut down on the amount of illegitimate traffic that hits your server18:41
willwhhow do I do that exactly? :)18:41
DarwinSurvivordo you have direct access to the iptables rules file?18:43
willwhDarwinSurvivor: yeah I have root on the box18:43
DarwinSurvivorok18:44
willwhgotta take a call, back asap18:44
DarwinSurvivorfirst move rule 5 to right after rule 1 (so that banned ips are blocked even if they had already connected)18:44
DarwinSurvivork18:44
DarwinSurvivorbrb18:46
DarwinSurvivorback18:53
willwhDarwinSurvivor: yo19:23
willwhis it possible to move rules?19:23
willwhlike #2 -> #719:23
DarwinSurvivorwillwh: what do you use to set the firwall rules? (iptables.rules file, bash script, web interface, etc)?19:25
willwhjust command line19:26
willwhand services iptables save19:26
willwhther eis a web interface19:26
willwhtoo19:26
DarwinSurvivorwhat distribution?19:27
willwhdebian :D19:27
willwhI don't really like the route ubuntu has gone recently :(19:28
DarwinSurvivorsee if there is an iptables.rules (or similar) file in /etc/19:28
DarwinSurvivorthere may be 2 files (iptables.up.rules and iptables.down.rules)19:29
willwh/etc/iptables: rules & iptables.conf19:29
DarwinSurvivoris rules a file or directory?19:30
willwhfile19:30
willwhand it's generated by iptables --save19:30
willwhsorry19:30
willwhiptables-save19:30
willwhargh - another call19:30
willwh:(19:30
DarwinSurvivoryes, that is a saved copy of all the iptables rules (which can be loaded with iptables-restore)19:31
DarwinSurvivoran easy way to modify the running firewall is to edit that file, then run iptables-restore again19:31
DarwinSurvivorif you don't want to mess with the system files, you could also use iptables-restore to create a new copy, then modify that19:35
DarwinSurvivorOne hint: add an ACCEPT for your personal IP address at the very beginning of the INPUT chain so that you can always log back in if you mess up the firewall!19:41
willwhroger19:55
willwhso one more question DarwinSurvivor19:55
willwhit seems that I don't need all these chains19:55
willwhI should just use an INPUT / OUTPUT / FORWARD?19:55
willwhgot it all ironed out20:00
willwhI really appreciate the advice, thanks very much DarwinSurvivor :)20:00
DarwinSurvivorno problem20:09
DarwinSurvivorusing chains can simplify some things (like with fail2ban), but can also over-complicate things if you don't understand what they are doing20:11
willwhkey Kip :D22:55
willwhhow's it going man?!22:55
willwhDarwinSurvivor: you still around?22:55
willwhgot an odd one22:55
willwhthis works: ssh -i .ssh/ec2netro.pem ubuntu@ec2-23-21-37-13.compute-1.amazonaws.com22:55
willwhthis in my .ssh/config - does not22:55
willwhHost ec2netro22:56
willwhHostname ec2-23-21-37-13.compute-1.amazonaws.com22:56
willwhUser ubuntu22:56
willwhPreferredAuthentications publickey22:56
willwhIdentityFile "/home/willwh/.shh/ec2netro.pem"22:56
willwhwhich is VERRRY strange22:56
willwhI don't understand :[22:56

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!