Networking :: Iptables-restore Command Operates Atomically?
Oct 19, 2010
Anyone know if the iptables-restore command operates atomically? I want to make sure that the entirety of in-kernel iptables are switched over to those specified in the input to iptables-restore, all at once, with no intervening emptiness, incompleteness, or mixing with prior table. The man page doesn't say about this.
View 3 Replies
ADVERTISEMENT
May 4, 2010
I'm setting up a server with Jaunty Jackalope version. I'm trying to test setting up a basic iptables rules... No matter which command I put in, it is failing on the first command when I run iptables-restore < file location (the first rule always fails). I'm doing this on the root user and first typing in the iptables rules in a test file. I've tried the first command starting with % sudo, iptables and -A. All have the same result. I've also tried letting the HTTP rule be first with the same result.
[Code]...
View 2 Replies
View Related
Nov 26, 2010
I am unable to restore my iptables from iptables-save after upgrading Fedora. I cannot get iptables-restore to work, and I have resorted to entering rules manually using the GUI.
View 2 Replies
View Related
Jul 17, 2010
IPtables creates an error during startup as well as when I try to restart it: Here's the output of:
[Code]....
View 11 Replies
View Related
Jun 21, 2011
I have a config script for a particular software package that does...
iptables-restore < /etc/sysconfig/iptables > /tmp/firewall.log 2>&1
The problem is, the output hangs after this. If the user hits a return, the rest of the output comes to the screen and the script finishes normally. But the script looks like its hung because of this odd iptables-restore behavior.
View 1 Replies
View Related
Jan 27, 2010
what could this bei saved my correct iptables file @ Code: /etc/iptables.up.ruleswhere webmin is looking for it.webmin config is to automaticly boot this file and addes a line at.
Code:
/etc/network/interfaces
file
[code]...
View 4 Replies
View Related
May 9, 2010
After resetting a pc running lenny I get iptables errors at boot ("resource temporarily unavailable", "bad rule" etc). "setting up firewall" (Guarddog) is not followed by any errors and the firewall apparently operates ok.How can I restore my iptables to the default installation values?
View 2 Replies
View Related
Sep 7, 2010
I am still new in linux (Redhat) i used dump command to backup the root of the linux server: #dump -0u -f /dev/st0 / the command is achieved. how to restore this dump.
View 2 Replies
View Related
Jul 25, 2009
i want to execute iptables command via php. i can run simple command as echo 'iptables -h'; but i can't run ipables -L and i create excutable file (firewall.sh). i can run it on console but not done on php.
View 7 Replies
View Related
Mar 8, 2010
I am building 1 system includes 1 firewall server using iptables 1 Webserver && 1 FTP server. On FTP server IP: 192.168.1.2 - GW: 192.168.1.1, I installed ProFTPD successfully. In LAN I do everything successful.
On Firewall server <IP PUBLIC> on eth0 && IP LAN eth1: 192.168.1.1
Iptables rules:
Code: # Generated by iptables-save v1.3.5 on Sun Mar 7 21:01:16 2010
*nat
:PREROUTING ACCEPT [950:126970]
:POSTROUTING ACCEPT [89:5880]
:OUTPUT ACCEPT [19:1342]
-A PREROUTING -d <IP PUBLIC> -i eth0 -p tcp -m tcp --dport 21 -j DNAT --to-destination 192.168.1.2:21
-A POSTROUTING -s 192.168.1.2 -o eth0 -j SNAT --to-source <IP PUBLIC>
COMMIT
# Completed on Sun Mar 7 21:01:16 2010
# Generated by iptables-save v1.3.5 on Sun Mar 7 21:01:16 2010
*filter
:INPUT DROP [1599:157409]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [232:34452]
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
-A FORWARD -i eth0 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o eth0 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -o eth1 -j ACCEPT
COMMIT
# Completed on Sun Mar 7 21:01:16 2010 In FTP server i access to internet good.
I check port 21 on IP PUBLIC , it's return Open.
But when I using ftp command then it's show Code: Connected to <IP PUBLIC>.
220 ProFTPD 1.3.3 Server (FTP Server) [192.168.1.2]
User (<IP PUBLIC>:(none)): longvnit
331 Password required for longvnit
Password:
230 User longvnit logged in
ftp> dir
200 PORT command successful
Aborting any active data connections...
ftp> bye
C:Documents and SettingsLONGVNIT>ftp <IP PUBLIC>
Connected to <IP PUBLIC>.
220 ProFTPD 1.3.3 Server (FTP Server) [192.168.1.2]
User (<IP PUBLIC>:(none)): longvnit
331 Password required for longvnit
Password:
230 User longvnit logged in
ftp> dir
200 PORT command successful
425 Unable to build data connection: Connection timed out
ftp> dir
200 PORT command successful
425 Unable to build data connection: Connection timed out
ftp>
View 5 Replies
View Related
Jun 15, 2011
we have a customer that ran a sudo chmod +x -R * command on his / filesystem by mistake and now the machine cannot be accessed on the network Has anyone any idea what chmod command to run to restore the system to its original state ?
View 1 Replies
View Related
Feb 25, 2010
I do computer forensics here in Afghanistan and I am trying to keep a clean image of a dual bootable hard drive. Here is what I try to do...
1. Boot into UbuntuLiveCD
2. I run "sudo dd if=/dev/zero of=/dev/sda conv=sync,notrunc bs=64K" to wipe the drive with all zeros.
3. I then install Windows by creating a new partician about 50GB.
4. I then install Linux by creating a partician in ext4 mounting it at '/' in addition I create a swap partician.
5. Next configure everything just the way I want it. I install all the drivers and software I need for my windows partician and build out the remaining part of the disc as a "data drive."
6. Then I use "dd" again to try to image my "clean slate" of a system. Remember I am dual booting. I dd the /dev/sda and gzip it.
7. When I go to restore it, I boot from the live CD again and unzip ig and "dd" it back onto /dev/sda.
8. I run fdisk -l and I get:/dev/sda1 * 1 6375 5120000000 7 HPFS/NTFS/dev/sda2 6376 11724 42965842+ 83 Linux/dev/sda3 11725 12453 ...... 82 Linux swap / Solaris.This means to me that it can "understand the file system"
9. But then when I take out the Live boot CD and try to get my "clean slate" machine back, the system goes into Grub Rescue mode with a grub command line "grub rescue>"
10. I tried using the tutorial on Grub2, but...
a. It would not understand the command "linux"
b. When I try to do insmod, it says it doesn't recognize the file system.
View 4 Replies
View Related
May 7, 2011
are there any sweeper / cleaner apps which can take back my installation as to when it was new. I know home directory could have config files etc..but that doesnt matter, i want all packages and applications reset to how it was when i had a clean install. I am using Natty
View 2 Replies
View Related
Sep 17, 2010
I am facing a strange problem witht my iptables as there are some firewall entries stored somewhere which is displaying the below firewall entries even after flushing the iptables & when I restart the iptables service then the firewall entries are again shown in my iptables as shown below,
[root@myhome ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
[code]....
View 6 Replies
View Related
Nov 3, 2010
I recently installed a new Ubuntu PC that runs iptables and PSAD. I had the same script on another Ubuntu PC, but when I copied the script onto the new PC, I got this error. I don't remember where I found the tutorial for this, all I know is that this is the script (Edited for my usage):
Code:
#!/bin/bash
# Script to check important ports on remote webserver
# Copyright (c) 2009 blogama.org
# This script is licensed under GNU GPL version 2.0 or above
[code]....
Safe.txt contains:
Code:
127.0.0.1
192.168.1.8
192.168.1.1
98.200.58.73
192.168.0.1
And the error message generated is:
Code:
root@NETWORK-SERVER:/var/ddosprotect# ./ipblock.sh
' not found.4.4: host/network `127.0.0.1
Try `iptables -h' or 'iptables --help' for more information.
' not found.4.4: host/network `192.168.1.8
[code]....
View 3 Replies
View Related
Mar 19, 2011
Alright, I'm trying to use KMyFirewall on Squeeze and it doesn't do anything. Whenever I do something that's supposed to require root access, it does not prompt me for the root password and as such, it doesn't work. For example, I setup a basic firewall that only accepts established and related connections coming in, and cannot run it due to the "iptables" command requiring root. This means that when I press the button to run the firewall (not install, run) nothing happens.
I believe this is related to the bonehead move to remove or cripple kdesu in Squeeze and/or KDE4. Is this the case or is something else wrong here? I would like to run a personal firewall on my laptop without spending a day and a half writing rules by hand. I'd also like to quickly poke holes in it for applications when needed, so please don't say something stupid about doing it by hand. I'm looking for help with a program that appears broken in the stable release.
View 5 Replies
View Related
Apr 16, 2011
I am running Ubuntu server 10.10 and trying to setup iptables rules in /etc/if-up.d/iptables
Quote:
root@host# cat /etc/network/if-up.d/iptables
#!/bin/sh -e
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Problem is that iptables doesn't get updated and I don't see them when iptables -L is executed after reboot.
View 2 Replies
View Related
Apr 28, 2009
To expand: I'm trying to set up a box with l7-filter, and I need to patch and compile iptables 1.4.1.1 as part of the process. I ./configured it with the prefix= argument so it would install into /sbin instead of /usr/sbin, and I did a yum remove iptables before installing it so as not to get in the way of the original iptables, but I'm wondering if this is really necessary - it's kind of annoying, because removing the original iptables removes the init.d script, deregisters the service, etc. If I don't, is it possible that iptables 1.4.1.1 might get overwritten in a system update or something, or will yum see that I've got a custom/newer version in there and leave it be?
View 4 Replies
View Related
Feb 5, 2010
Iptables manual page says:
Why doesn't it make sense for packets coming from a wireless interface?
View 1 Replies
View Related
May 7, 2010
I have set up OpenVPN for my connection. I'm using this to connect to the internet from different locations using tunnelling.
Right now I have a few IP's : on eth0 I have IP from my ISP, on eth0:1 I have my own IP.I set up MASQUERADE to eth0 - but in this case when I try to access my restricted resources IP address from ISP is visible.
What I want is to use my own IP address from eth0:1 - could somebody help me to build good working redirect entry for that? I want to redirect all connections to that IP assigned on eth0:1... - just to access Internet using my IP.
View 3 Replies
View Related
Nov 11, 2010
How can I add ip address which is multiple of 3 and to 255? That is I want to block ip address which is coming from multiple of 3 to 255.
As an example 192.168.0.3,192.168.0.6,192.168.0.9,192.168.0.12 etc.
View 4 Replies
View Related
Mar 2, 2010
how to allow a specific hostname with specific ports in iptables?
View 1 Replies
View Related
Apr 24, 2011
We are stuck big time with IP forwarding where we have to use IP tables. Any advice will be appreciated.
Setup
Machine A --> Machine B -->Machine C
- Machine A connects with Machine B on "internal network"
- Machine B has 2 NIC (and two IP address) , one connected to Machine A (internal network) and one connected to Machine C (External Network)
We need all traffic coming from Machine A which flows to Machine B on port 60 to be directed/forwaded to Machine C (port 60).
Not allowed to configure Machine B as a gateway . Things work with rinetd program when we do a tcp redirect from Machine B port 60 to Machine C (port 60).
But just unable to make it work with IP tables rules. We tried following,but in vain
iptables -t nat -A PREROUTING -s Machine_A -d Machine_C -p tcp --dport 60 -j DNAT --to-destination Machine_C .6:60
/sbin/iptables -A FORWARD -i Machine_B -o Machine_C -p tcp --dport 60 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
Any valued inputs?
View 4 Replies
View Related
Jul 26, 2010
pc need download file from internet ftp server, but can't now, how set iptables ?
iptables mod
[root@ad ~]# lsmod |grep ip
ip_nat_ftp 7361 0
ip_conntrack_ftp 11569 1 ip_nat_ftp
[code]....
View 4 Replies
View Related
Dec 13, 2010
I have 2 Linux boxes one acting as a router with a direct connection to the internet, second as a server using the first box as a gateway to the internet. I need to forward requests that I get from the outside to port 8400 to my internal server box at 192.168.0.7:8400
Router IP 192.168.0.5
Server IP 192.168.0.7
iptables -t nat -A PREROUTING -p tcp -d [internet ip] --dport 8400 -j DNAT
[code]...
These rules are on the router (192.168.0.5) I've been trying to find a solution for hours with no success. Basically the problem is I can forward ports on the same box but not to a different ip.
View 1 Replies
View Related
Mar 18, 2011
iptables -A INPUT -p udp --dport -j ACCEPT
iptables -A INPUT -p tcp --dport -j ACCEPT
iptables -A FORWARD -p udp --dport -j ACCEPT
iptables -A FORWARD -p tcp --dport -j ACCEPT
and the rules are placed in iptables, i can see them when I do iptables -L. But when I do netstat -an | grep 161 I can see that port 161 (SNMP) is not listening. Why?
View 7 Replies
View Related
May 9, 2011
I just want to allow only some udp ports and deny all tcp access as my script below:
Code:
# Generated by iptables-save v1.3.5 on Sun May 8 17:33:16 2011
*filter
[code]....
View 3 Replies
View Related
Jan 19, 2010
I am working on optimizing the iptables. I came across some way of optimizing the rules by removing the redundant rules and merging the rules . Is there any other way to increase the optimization of iptables ?The network that we applied the iptables is a simple LAN network. (College Network)
View 1 Replies
View Related
Aug 3, 2010
how to let iptables to allow dns & dhcp distributions from the server to the clients only w/out exposing the port dhcp port udp 67,68 and tcp port 67,68 as well from the outside world.DHCP only uses udp, but still I also allowed tcp ports as well just to be sure & also I already allow DNS ports in the firewall w/c is not inluded below. linux newbie here,
when i issued the command below to allow those ports only to the internal network the firewall still blocking it. what seems to be the problem?? #iptables -A INPUT -m iprange --src-range 192.168.0.1-192.168.0.254 -p udp --dport 67 -j ACCEPT
[Code]...
View 1 Replies
View Related
May 6, 2010
IPtables, implementing each type of NAT
-Full Cone NAT
-Restricted Cone NAT
-Port Restricted Cone NAT
-Symmetric NAT
using IPTables.
Explanation:
Full Cone: A full cone NAT is one where all requests from the same internal IP address and port are mapped to the same external IP address and port. Furthermore, any external host can send a packet to the internal host, by sending a packet to the mapped external address.
Restricted Cone: A restricted cone NAT is one where all requests from the same internal IP address and port are mapped to the same external IP address and port. Unlike a full cone NAT, an external host (with IP address X) can send a packet to the internal host only if the internal host had previously sent a packet to IP address X.
Port Restricted Cone: A port restricted cone NAT is like a restricted cone NAT, but the restriction includes port numbers. Specifically, an external host can send a packet, with source IP address X and source port P, to the internal host only if the internal host had previously sent a packet to IP address X and port P.
Symmetric: A symmetric NAT is one where all requests from the same internal IP address and port, to a specific destination IP address and port, are mapped to the same external IP address and port. If the same host sends a packet with the same source address and port, but to a different destination, a different mapping is used. Furthermore, only the external host that receives a packet can send a UDP packet back to the internal host.
On the netfilter mailinglist, Pedro Goncalves suggested the following:
192.168.2.170 is "public" address and 10.0.0.1 is "private" address
/-"Full Cone NAT", with the following rules:/
HTML Code:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.2.170
iptables -t nat -A PREROUTING -i eth0 -j DNAT --to-destination 10.0.0.1
/-"Port Restricted Cone NAT", with just a single rule:/
HTML Code:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.2.170
View 1 Replies
View Related