iptables is the userspace command line program used to configure the Linux 2.4.x and 2.6.x IPv4 packet filtering ruleset. It is targeted towards system administrators. Please, when asking a question about iptables, add the output from the following command: iptables -L -v -n

learn more… | top users | synonyms (1)

0
votes
0answers
18 views

Hairpin NAT with dynamic WAN IP [migrated]

I have a dynamic WAN IP so if it changes my iptables will no longer apply. Here is my working hairpin nat, where x.x.x.x is my WAN IP br0 - LAN eth1 - WAN -A PREROUTING -d x.x.x.x -p tcp --dport ...
0
votes
0answers
17 views

Forward port 80 to 8080 for a specific IP on the network

I have a specific PC on my network running a web service on port 8080. I also have a different machine which acts as a gateway/router, which I configure using iptables rules. What I want to do is ...
2
votes
1answer
36 views

Forward SSH to another Host

I have an ubuntu server which is visible from internet, let's call it "jumper". And this server has this name actually because I need that whenever an user SSH this server, it jumps (or forward or ...
3
votes
1answer
1k views

Possible for linux bridge to intercept traffic?

I have a linux machine setup as a bridge between a client and a server; brctl addbr0 brctl addif br0 eth1 brctl addif br0 eth2 ifconfig eth1 0.0.0.0 ifconfig eth2 0.0.0.0 ip link set br0 up I also ...
11
votes
3answers
23k views

Why do ICMP Redirect Host happen?

I'm setting up a Debian box as a router for 4 subnets. For that I have defined 4 virtual interfaces on the NIC where the LAN is connected (eth1). eth1 Link encap:Ethernet HWaddr ...
1
vote
1answer
29 views

How does iptables --hitcount collect its values

Im looking at SSH bruteforce prevention with iptables recent module. I would like to know how does the --hitcount collect the value that it will use? Is it bytes, packets, no. of conntracked items or ...
1
vote
2answers
17 views

OpenVPN per user rules while not routing Internet traffic

EDIT: I know that learn-address is what I would need to use to call a script (as specified in the openvpn-netfilter project) to set the firewall rules. I guess my question is more related to the ...
-1
votes
0answers
27 views

Iptables Rules To Route Traffic Between Two Local Processes

I want to set up the rules in iptables of a system (10.1.1.25lan and 192.168.0.25wan) in such a way that any traffic (from other local systems, ex-10.1.1.x) with any 'original destination:port 111" is ...
0
votes
0answers
27 views

Prerouting with iptables, destination port to DHCP ip

I have an iptables rule that translates requests to the same IP from different internal hosts by changing the source port. iptables -t NAT -A POSTROUTING -p TCP -d 173.32.1.2 --dport 873 \ -m state ...
1
vote
0answers
16 views

Postfix not accepting external connections

I have set up a postfix server that works just fine when accessed as localhost. However I cannot make it available from the outside. The relevant configs are as follows: /etc/postfix/main.cf ...
1
vote
1answer
24 views

Route ipsec to openvpn with iptables

I am not a very experienced user but I do have determination, after a week with no progres it is getting rough. I have two NIC, one facing to the internet and one towards the internal network. Both ...
6
votes
1answer
4k views

connect Open vSwitch switch to real network : iptables masquerade

I'm using Open vSwitch to create a switched network between virtualBox guest machines, and i want that the host OS (Ubuntu 12.04) join this network and to configure it as the gateway of this virtual ...
0
votes
0answers
10 views

Redirecting log from /var/log/kern.log to a separate log file for iptables log

I am trying to redirect iptables log to another file. Based upon my reading on the net, I did the following: In my iptables rule, I have rules like: iptables -A INPUT -s ... -j LOG --log-prefix ...
3
votes
2answers
63 views

Ubuntu as NAT Gateway with iptables

I'm trying to configure Ubuntu 14.04 to act as a NAT gateway between a private and public network. Public Interface -> eth0 (178.x.x.x) Private Interface -> eth0:0 (192.168.206.190/17) I've tried ...
1
vote
2answers
3k views

iptables block client ip internet access and keep LAN access

With the increase of appliances having network access and the potential for hacking, I want to block specific ip address from accessing the internet, but allow LAN access. For instance, I use a ...
0
votes
0answers
16 views

KVM - libvirt qemu script make duplicates in iptables

OS: CentOS 7 Firewall: iptables libvirt: 1.2.17 Problem: I used guide to make port forwarding from host to gues machines. Link to guide: ...
0
votes
0answers
28 views

Can access server via SSH/FTP but other protocols won't work

I followed this guide to setup an "Upside-Down Ternet." Everything was fine up until the part where I configured IPTABLES then I lost SSH connection. Now I expected that because I'm messing with ...
2
votes
1answer
36 views

An iptables rule doesn't work

I'm facing the following problem: I want to block the port 8000 being accessed from the network (block all connections except the ones from 127.0.0.1). So to simplify my problem and as a first step, I ...
-1
votes
0answers
35 views

IPTABLES and NFTABLES [on hold]

Are there any major technical differences between nftables and iptables? I need to implement one and I am finding more documents on iptables hence I get the feeling it is much easier. Does anyone have ...
0
votes
1answer
39 views

policy routing to guests on other server

After long searching I've found the answer to my challenge, but the last step fails. I have two identical servers that both serve multiple guests. The servers have two interfaces: one for the ...
-2
votes
1answer
35 views

SAVE IP ROUTE RULES AFTER REBOOT

I have two internet connections from two different ISPs and I need to balance & failover the traffic originating to and from my network between the two ISPs. My settings: FIRST ISP (eth0): ...
1
vote
1answer
22 views

Missing firewallD in CentOS 7 VPS

i fresh installed CentOS 7 in a OVH VPS. but when i ran the command firewall-cmd i got this: -bash: firewall-cmd: command not found so i was looking how resolve that and i saw that basically i ...
0
votes
1answer
86 views

OpenWRT reroute all router traffic through a Client

I have an OpenWRT router (192.168.1.1) with various wired and wireless clients (192.168.1.x). One of the clients is a Suricata Sensor (192.168.1.100) with only one, 1000MBbit NIC. I want to ...
1
vote
1answer
2k views

Ubuntu iptables logs not going to any log file

I am trying to put logs in iptables but I can not find any log in any file. Although when I run dmesg command, I can see the iptables entries. But the same entry doesn't go to any log file. Here is ...
1
vote
1answer
3k views

Any help on how to use iptables to postroute to eth0:2 alias in ubuntu?

On my server I want to route my internet traffic over my eth0:2 alias. When I use this command: sudo iptables -t nat -A POSTROUTING -s 10.8.0.4 -o eth0:2 -j MASQUERADE It returns this: Warning: ...
-1
votes
1answer
22 views

How can I only allow TCP connections for 1 port using iptables on Unbantu? How can I also set a maximum packet on a connection?

I'm running a server for public. I just want to allow TCP connections and I want to limit the packet to prevent ddosing a bit and setting a maximum IP/new connections per seconds with iptables. How ...
1
vote
1answer
32 views

Howto configure Ipset to block entire countries IPs

I need to block some countries using ipset and iptables. What I've done so far (create new ipset set 'geoblock'): sudo ipset create geoblock hash:net,port then I created the following script ...
0
votes
1answer
12 views

iptables port forwarding to specify ip

I use the following command to forward tcp 2222 in a host node to tcp 22 in a vm (192.168.0.100): iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2222 -j DNAT --to-destination ...
2
votes
3answers
83 views

What does -P INPUT ACCEPT mean with regards to iptables?

I'm fairly new to iptables, and am trying to figure out if I've configured my ruleset appropriately. With regards to the -P INPUT ACCEPT part of my question, I am trying to determine if this is valid ...
2
votes
2answers
42 views

Check if iptables rules are working

I have three virtualboxs. 1) Virtual machine VM-A that works as a router with two interfaces: eth0 - 10.160.10.254 eth1 - 172.10.0.254 2) Virtual machine VM-B that works as an internal network ...
0
votes
1answer
1k views

ZenOSS webinterface connecting

I'm having a problem with ZenOss. I installed the centos stack installer on Centos 5.5 x64. De installation succeeded and no errors where displayed. But when I tried to surft to the ip address it ...
4
votes
2answers
2k views

OpenVPN bypass on some ports

I have a server running Debian 7 and I would like to connect to a VPN and let all the traffic pass via the VPN except for some ports (SSH, hosted websites, etc). I've searched for some time now in ...
0
votes
0answers
18 views

netfilter, block port range [31000-32000] on public interface eth2

I need to block the port range [31000-32000] on my public interface eth2. Services can be accessed using private network interface eth3 I have tried : root@master-sbg-01:~/# iptables -A INPUT -i ...
1
vote
1answer
2k views

Missing iptables rules for Strongswan routing for VPN for phone

I have a Centos 6.6 VPS out on the Internet that has a public IP. I have installed StrongSwan 5.1.3 to allow my BlackBerry10 phone to connect from hotspots and use the VPS' connection. The VPS' IP ...
-2
votes
0answers
22 views

CentOS Convert iptables rule to firewall-cmd rule [closed]

I have the following iptables-rules on CentOS 6: iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name ssh --rsource iptables -A INPUT -p tcp --dport 22 -m state --state NEW ...
3
votes
2answers
1k views

iptables 1.4 and passive FTP on custom port

after the upgrade from debian squeeze to wheezy I've got a problem with passive FTP connection. I could narrow it to be iptables related, as I could connect via FTP w/o problems after adding my IP to ...
2
votes
1answer
1k views

Route outbound connections from local network through VPN

I have a server A running OpenVPN, an OpenVPN client B (a rooted Android phone as it happens) and a third party C (a laptop, tablet etc.) tethered to B. B can use the VPN to access the internet via ...
1
vote
0answers
30 views

Drop fragmented packets in nftables

Using iptables is it possible to block fragmented packets with this rule: iptables -A INPUT -f -j DROP But there isn't a equivalent in nftables. There is any way to do it?
2
votes
0answers
31 views

Block incoming traffic in bonding mode when primary interface is down

My server running on latest kernel (4.4.6) has configured a bond device (bond0) with two enslaved interfaces eth0, wlan0 with primary interface eth0. cat /proc/net/bonding/bond0 Ethernet Channel ...
0
votes
0answers
9 views

How to isolate two containers connected to the same bridge?

I have several LXD containers which are bound to a single bridge (the default lxdbr0 or another one, it does not matter). The host itself has another two interfaces, one ultimately connecting it to ...
2
votes
1answer
3k views

strongswan VPN on OpenWrt

Hi I'm running Barrier Breaker version of OpenWRT and I have setup a VPN according to: http://wiki.openwrt.org/inbox/strongswan.howto I can connect to the VPN with my iPhone or Mac (to 10.10.1.0/24 ...
0
votes
0answers
12 views

Iptables linux routing with 2 chain proxies

Im trying to setup a connection between a PCs in my local network, to foreign resource XYZ in a specific way. My network is currently configured like this: I have a pc behind the proxies -> Then I ...
1
vote
0answers
12 views

Iptables multiple port redirects based on destination address

I have iptables setup for selective routing. In the current configuration it checks if the dst address is listed in a specific chain and if it is not it redirects the traffic to my proxy port which is ...
0
votes
2answers
1k views

grep, count and sort iptables log to get IPs qty and DPT?

How can I grep count and sort iptables log to get IPs quantity and DPT? Like I used this oneliner to get top IP quantity. egrep -w "Invalid Packet" ipfirewall.log | grep -o ...
1
vote
0answers
16 views

Route all traffic from virtual interface to temporary tun0

I'm trying setting up at home an automated torrent client to download some big GIS databases I produce at work and release as .torrent files. My home server is a Raspberry PI with one Ethernet ...
0
votes
1answer
13 views

Edited IpTables, now SFTP suddenly stopped working

I removed some things from my IPTables that were no longer needed and now my SFTP simply times out upon attempting to connect with FileZilla: Status: Connecting to ###.93.110.###... Response: ...
1
vote
1answer
55 views

Allow Docker containers to use IPSEC VPN on host

I have Docker and an IPSEC VPN tunnel on my workstation, but the containers can't access hosts behind the VPN. Is there anything I can do, e.g. with IPTables or routes to allow access? [Note: I'm ...
0
votes
1answer
50 views

OpenVPN Ubuntu Server Routing Problems No Internet

I'm running OpenVPN on Ubuntu 15.04. When I connect to the server, I can connect and authenticate correctly (I use PAM auth because I'm lazy). Once connected I can't ping the server or access the ...
0
votes
1answer
50 views

Can't establish SSH connection even on localhost

Having problems getting a simple SSH connection to even localhost on my Ubuntu 15.10. Server was set up many months ago and was able to create access for SSH with keys, but cannot duplicate that ...
-1
votes
1answer
44 views

How can I block access to the internet for static addresses?

I have a router on CentOS 7 which provides access to internet for several IP addresses, which are reserved at DHCP server. Other hosts are blocked. If someone put static address from the reservation ...