iptables allow creation of rules to define packet filtering behavior.

learn more… | top users | synonyms

9
votes
0answers
260 views

Linux iptables ssh port forwarding (martian rejection)

I have a Linux gateway performing NAT for my home network. I have another network which I'd like to transparently forward packets to, but only to/from specific IP/ports (ie. not a VPN). Here's some ...
5
votes
0answers
61 views

Simulate ethernet cable unplugged on a remote machine while staying connected

I am working from home on remote embedded Linux machine "X" via ssh. It has one physical network card. I need to simulate Ethernet cable unplugged condition on the same remote machine "X" , while ...
4
votes
0answers
441 views

iptables rule no actions on scapy packets

I wrote this rule to change all udp destination IP addresses to 8.8.8.8 when dport is 53: iptables -t nat -A OUTPUT -p udp -m udp --dport 53 -j DNAT --to-destination 8.8.8.8 The rule worked when ...
3
votes
0answers
28 views

No “unreachable” response for an outgoing TCP connection when using fwmark and policy routing

I would like to route locally-generated traffic: to a TCP port "A" of host "H" via the interface "A", to a TCP port "B" of host "H" via the interface "B". Interface "B" is sometimes unavailable. ...
3
votes
0answers
42 views

TC (Traffic Control) to control bandwidth

I'm having an issue with a bandwidth script that I've been using for a while to limit the outgoing bandwidth on a port. It worked fine at the beginning until I wanted to change the outgoing port ...
3
votes
0answers
16 views

Routing policy is not working

I have an Access Point with OpenWrt. On other host of the same LAN there is a squid (IP Address 192.168.80.148). I'd like to route packages with destination port 80 to 192.168.80.148. So I have ...
3
votes
0answers
118 views

iptables and ip forwarding for failover

hi i have an ethernet nic interface with 4 additional virtual interfaces (failovers) all configured with public ip4 (IP-1 to IP-5) / netmask 255.255.255.255 / broadcast addr same as ip: eth0 ...
3
votes
0answers
36 views

Configuring a Linux Wi-Fi access point to redirect a one-word URL to http://192.168.42.1:8888

've created a Wi-Fi access point on a Linux box (thanks to hostapd). I'm trying to make it easy for clients to access the Freenet service that's running on said box. Ideally, the user would be able ...
3
votes
0answers
300 views

Captive Portal on Raspberry Pi (raspbian) with Bridged Adapter

I am trying to create a captive portal on a Raspberry Pi by following the steps from this GitHub project: https://github.com/thgh/pilon I have 2 network interfaces on the pi. wlan0 TP-Link ...
3
votes
0answers
1k views

Is it possible to throttle upload bandwidth per `IP` basis using `tc`, `htb` and `iptables` ? (Download limitation not required)

Problem I've searched internet like anything but couldn't find much about limiting upload. The solutions given are not limiting IP basis like this one but LAN as a whole. +-----+ ...
3
votes
0answers
197 views

Restrict the maximum number of independent IP connection on specific port at the same time

I set up a server as a socks5 proxy. I'd like restrict the maximum number(1 or 5 or 20) independent IP connection on specific port at the same time. I have searched on google, only see some articles ...
3
votes
0answers
369 views

iptables: using “conntrack” and “recent” modules to block unsolicited packets

When I only allow RELATED and ESTABLISHED packets, and DROP everything else, my firewall rules work perfectly and I have no problems: ### VARIANT A -A INPUT -i wlan0 -m conntrack --ctstate ...
3
votes
0answers
233 views

Is iptables able to filter off UNREPLIED connections?

I am a using dd-wrt router and trying to get some per-user metrics, I was wondering about filtering only ESTABLISHED connections or include NEW and RELATED, I have read a lot about this last two, but ...
3
votes
0answers
867 views

Forward multicast between two LAN segments (Chromecast)

I've found some rules but most are inconclusive. Chromecast uses DIAL and discovers via multicast from what I've understood.. I have an Ethernet-connected computer which I would like to route via my ...
3
votes
0answers
552 views

iptables hangs at applying rules

I have a set of rules that are supposed to give me the most protection before things like fail2ban and other things are added to the mix. The issue is that although everything checks out in the test, ...
3
votes
0answers
162 views

Packets do not cross IP tables Postrouting when originating from an external IP

I'm trying to reflect traffic from the internet to an internal device that I only want to have local access. I have a host in my DMZ that I'm trying to DNAT traffic to this internal device, and SNAT ...
3
votes
0answers
888 views

Route all HTTP traffic through polipo

I've set up polipo on my machine to listen to the default port 8123. To test it, I set the in-memory cache to a ridiculously high 2 GB and downloaded a 50 MB file using wget utilizing the proxy. ...
3
votes
0answers
541 views

Redirect all non-local traffic to a socks proxy

Is it possible to redirect all non-local traffic to a socks proxy? so, for example i have: 4 computers (clients A-D: 10.0.0.1-4 or dhcp) 1 computer with 2 network cards (gateway-server, eth0: ...
3
votes
0answers
202 views

iCloud stuff stops working while connected to OpenVPN

I have a fairly simple OpenVPN setup on an OpenVZ VPS with Ubuntu 11.10. Client is the Viscosity client on Mac OS X 10.8.2, and after some testing, we can rule out the client as being part of the ...
3
votes
0answers
759 views

tunneling FON traffic via Tor

I would like to tunnel the traffic of my FON router through Tor. For that I added a second network card to a local server and connected the FON router to it. Then I set up a DHCP server and configured ...
2
votes
0answers
57 views

How to debug what is stopping ping to respond on our server?

We used to have a sysadmin person months ago who had disabled ping response on one of our servers. But now we want to re-enable ping response. I tried to check if the ping was disabled from config. ...
2
votes
0answers
44 views

Why could policy routing on iptables marks applied in FORWARD or OUTPUT chains be inconsistent?

I am routing HTTPS connections down a SSH tunnel (-w) using iptables marks and iproute2 rules, the reasons I need to do it this way are contrived, to say the least, so most alternate solutions may not ...
2
votes
0answers
21 views

Can I use iptables to forward between interfaces without setting /proc/sys/net/ipv4/ip_forward?

Can I use iptables to forward between interfaces without setting /proc/sys/net/ipv4/ip_forward? I want a secure default of not forwarding anything and then specifying exactly what should be ...
2
votes
0answers
59 views

Need for IPTables expert, possibly with knowledge of u32 module

A customer is sending queries against DNS root-servers on my recursive DNS server. I need to block it with iptables. I tried 3 examples but it is not working. 0 0 DROP udp -- * * ...
2
votes
0answers
124 views

Can I add iptables rule from the inside of a C Linux program only with capabilities or do I need necessarily root?

I need to add an iptables rule from the inside of a C Linux program. How should I do? Do I need root privilege or can I just grant some capabilities? I tried granting CAP_NET_RAW+iep and using ...
2
votes
0answers
39 views

iptables not working on mobile broadband

I access the internet using a VPN. With the help of iptables rules all out-going traffic from my machine to the internet is dropped instantly when my VPN connection is abruptly terminated. The ...
2
votes
0answers
112 views

How to restrict openvpn clients to communicate with other vpn clients

I have this Openvpn scenario.. I have Lot of openvpn clients connected to my server, All i want is to restrict client to client communication. for eg. i have ...
2
votes
0answers
48 views

Detect which program is blocked by firewall

The linux firewall can show a lot of information in the LOG target, for example via --log-uid. How can the executable doing the network call be logged, too? I did not find anything in the FAQ, the ...
2
votes
0answers
20 views

How to unwrap a tunneled packet in iptables/netfilter and process the tunneled packet

I have a specific question regarding the Linux netfilter/iptables interaction. Let's say I have an IP packet P1 inside of another IP packet P2 (that is, P1 is tunneled). Now, the question is as ...
2
votes
0answers
141 views

Two ISP and redirecting traffic

I have a gateway with two ISP connected to eth0 and eth2. There is also a eth1 with local network. I'm trying to group some services in one interface and some in the second: incoming traffic 1 ...
2
votes
0answers
154 views

Privoxy - Annoying Error Used IPTables

I'm running privoxy off a machine that also has hostapd installed, I am trying to run all http traffic from hostapd through privoxy i have already tried this: iptables -t nat -A PREROUTING -p tcp ...
2
votes
0answers
694 views

ip rule not acting on fwmark

I'm trying to use iptables to load balance web traffic over multiple DSL lines by marking the packets and routing based on the mark. I'm working with CentOS 6.6, Kernel 2.6.32-504.16.2.el6.x86_64, ...
2
votes
0answers
67 views

Why is traffic matching the public zone instead of the desired zone?

Trying to self-train on firewalld I set up apache and configured the zones as follows: [root@localhost ~]# firewall-cmd --get-active-zones work sources: 192.168.122.1 public interfaces: ens3 ...
2
votes
0answers
441 views

Routing traffic for specific user to specific interface

I have a Linux box with these interfaces: eth0 Link encap:Ethernet HWaddr 14:da:e9:ef:75:7d inet addr:176.9.85.182 Bcast:176.9.85.191 Mask:255.255.255.224 tun0 Link encap:UNSPEC ...
2
votes
0answers
1k views

restrict IP traffic between VLAN sub-interfaces

I have a router/firewall-PC with two VLAN sub-interfaces eth2.100 and eth2.200: I would like to allow communication between networks 192.168.100.0/24 and 192.168.300.0/24(PC3 network). In addition, ...
2
votes
0answers
176 views

Dropping packets before mangle POSTROUTING

In iptables on Linux 3.10, why do packets which have been DROPed by the FORWARD chain of the standard table still appear in the POSTROUTING chain of the mangle table? -- I'm trying to use the standard ...
2
votes
0answers
98 views

debugging iptables when tunneling one VPN through another

I seek to tunnel one SSL VPN (F5, running on my debian laptop==client) through another (OpenVPN, running on a debian linode==server), but lose all client networking (including, e.g., ping) after the ...
2
votes
0answers
74 views

Strange cron behaviour

I have a script that reads a list of IPs from a file, compares with the existing ones in a chain, and adds recently added IPs in the file into that chain. Running the script manually (e.g., ./script) ...
2
votes
0answers
60 views

VPN tunnel to two services on two servers?

I've got 2 CentOS 6.5 servers, each running one service: server A: 10.140.54.1/27 running service MySQL port 3306 server B: 10.140.54.2/27 running service httpd port 443 Server B's httpd service ...
2
votes
0answers
636 views

how to open up socks/SSH on different network interfaces?

iptables -A PREROUTING -i usb0 -t mangle -p tcp --dport 8080 -j MARK --set-mark 1 iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain ...
2
votes
0answers
362 views

SNAT with firewall-cmd?

I have an interface with multiple IP Addresses (on CentOS 7), which is in zone "external" (with masquerade on). I want to specify that, if a connectiona attempt to a specific address goes out, to use ...
2
votes
0answers
1k views

How do I route bittorrent through a second interface?

I've managed to configure openvpn on my DD-WRT router such that the tunnel is up and working, but that it doesn't mess with routes at all (the default configuration wants all traffic to go through ...
2
votes
0answers
414 views

iptables rule to transfer UDP through a SSH tunnel

The problem I have two programs that runs on two distant computers and communicate through a specific protocol. All I know is that this protocol only communicates through UDP and uses the ports 1101 ...
2
votes
0answers
63 views

Extra overhead in MASQUERADE target

There's a part in iptables manual concerning SNAT and MASQUERADE targets. I know the key difference between the two, but I don't fully get the following sentence: It is still possible to use the ...
2
votes
0answers
52 views

How can I configure iptables for per application setup?

I am working on a project where we are building lots of micro-services. Each service is neatly packaged as an RPM. Ideally I'd like for us to have iptables enabled on all of our machines and it would ...
2
votes
0answers
124 views

Transparent Proxy

I am setting up attempting to set up a transparent proxy on CentOS using Squid. So far I have managed to filter the content and get it working perfectly. The only issue I am having is getting a form ...
2
votes
0answers
206 views

Defining IPv6 chains in ip6tables-restore/iptables-restore files, is it possible?

The format for the files generated by iptables-save/ip6tables-save and loadable through iptables-restore/ip6tables-restore stipulates that one can prepend -4 or -6 respectively so as to maintain the ...
2
votes
0answers
392 views

iptables REDIRECT in combination with matching on interface vs. IP address

I've successfully set up Tor for transparent proxying using iptables (ie, all outgoing traffic is sent through Tor without the application's knowledge). In doing so, I discovered both an odd problem ...
2
votes
0answers
382 views

SNAT problem in iptables

I am trying to reroute traffic from specific devices in my house over openvpn. For this, I've created an OpenVPN tunnel between my house wifi router and my server. Here is my setup: Wifi router's ...
2
votes
0answers
406 views

IPTables dropping UDP packet stream

I have a configuration where UDP packets containing encapsulated DNS data are sent to a KVM instance for processing. The KVM instance sits behind an IPtables firewall which is also doing NAT. The ...