Questions tagged [iptables]

Iptables is a module that provides the Linux operating system functions of firewall, NAT and logging of data traveling over a computer network.

Filter by
Sorted by
Tagged with
2 votes
1 answer
5k views

Linux iptables DNAT on incoming packet without conntrack (stateless)

In my linux box 10.20.1.1, i got two UDP apps binded on port 46000 (App A) and 36000(App B) respectively. The apps communicate with two UDP servers bindeded as 10.10.1.1:36000 (Srv X) and 10.10.1.2:...
Telex's user avatar
  • 43
2 votes
1 answer
3k views

Make traffic go one-way by using iptables

I have a network topology: [C1] - [R1] - [R2] - [C2] C1-R1 network is 192.168.100.0/24 R1-R2 network is 10.9.8.0/30 R2-C2 network is 192.168.200.0/24 What I need to do is to make C2 be able to ...
Александр Гаращенко's user avatar
2 votes
1 answer
1k views

iptables - UDP Packets from unknown IP addresses

I'm really new to basic systems administration, and this question is a bit difficult for me to Google. I'm setting up a small raspberry pi server for my own personal use, to teach myself some basic ...
AStupidNoob's user avatar
2 votes
2 answers
4k views

mirroring traffic with iptables doesn't work

i want to mirror specific traffic to ip 192.168.200.1 i use this solution : Mirror Port via iptables but when i enter following command, error occurs: iptables –I PREROUTING -t mangle -j ROUTE --gw ...
saeed's user avatar
  • 31
2 votes
1 answer
1k views

Combination of NAT, DHCP, and OpenVPN on lubuntu 14.04

Okay, so I've got a set up, where eth0 my internal IP address (192.168.1.3) it has been configured as my default gateway using the iptables this sudo sysctl -w net.ipv4.ip_forward=1 sudo iptables -P ...
HilarieAK's user avatar
  • 785
2 votes
1 answer
2k views

Iptables deny access to a specific IP address not working

I'm not able to deny access to a specific IP address or deny access to a specific IP address range as well. My network environment is, I have one router which IP is (30.30.10.1) and second my hotspot ...
Jien Wai's user avatar
2 votes
1 answer
4k views

Bandwidth limit by Port on iptables

What iptables function would I use to bandwidth-limit all traffic on port 566 to 2KB/s? I'm confused about exactly how to do this.
sonicboom's user avatar
  • 161
2 votes
2 answers
13k views

Forward connections on 0.0.0.0:80 to 127.0.0.1:9091

I'm trying to set up a tor-relay. In order to allow tor to present a static web page explaining what it is I want the server to listen on port 80 and 443. In order to allow tor to use accounting/...
azzid's user avatar
  • 403
2 votes
1 answer
5k views

using iptables to prevent RST related to a specific port

I have a program which uses libpcap to capture incoming TCP SYN packets, these SYN packets are destined for a specific port. But I have no tcp listening socket for that port, so in practice, the OS ...
misteryes's user avatar
  • 2,985
2 votes
2 answers
4k views

OSX: Mimic Ubuntu IP Masquerading via iptables with ipfw

Good day, I am attempting to replicate a setup I have between a router and an Ubuntu PC, and have the same setup working on my MacBook (10.6, Snow Leopard). First, I have a router that has a USB ...
Cloud's user avatar
  • 551
2 votes
1 answer
1k views

Different routing rules for a particular user using firewall mark and ip rule

Running Ubuntu 12.10 on amd64. I'm trying to set up different routing rules for a particular user. I understand that the right way to do this is to create a firewall rule that marks the packets for ...
Paul Crowley's user avatar
2 votes
2 answers
5k views

iptables - Allowing Established Sessions?

I'm learning how to use iptables on ubuntu server. Can you please explain to me what "Allowing Established Sessions" means and why should I include it in rules? sudo iptables -A INPUT -m conntrack --...
user avatar
2 votes
1 answer
1k views

How to block access to a website on Lucid Lynx?

I am trying to block a few websites on a lucid lynx, I tried editing /etc/hosts and that blocks access via url but the site still open if I enter the ip on the browser, how can I block ip access also? ...
ldabl's user avatar
  • 97
2 votes
3 answers
5k views

iptables syntax to forward remote desktop requests to a virtual machine on CentOS host

I can rdesktop into a VM running Windows XP hosted on my CentOS 5.4 machine from the hosting machine and work just fine using the private address (192.168.122.65), but I now need to allow remote ...
NVRAM's user avatar
  • 838
2 votes
5 answers
22k views

What Iptables rules need I to forward a windows remote desktop connection?

I have this situation: network mask. 255.255.255.0 router/gateway: Ubuntu server (only command line, no gui) with internal lan ip 192.168.0.2 and a dynamic dns on the external ip Windows pc on 192....
apelliciari's user avatar
2 votes
1 answer
1k views

iptables drop all packets that do not come from two specific subnets

I want to drop all packets that do not come with a source IP in the subnets 11.2.4.0/24 and 11.2.3.0/24 I thought about doing something like so: iptables -A OUTPUT ! -s 11.2.4.0/24,11.2.3.0/24 -j DROP ...
chilliefiber's user avatar
2 votes
1 answer
69 views

Redirect OR warn (during initial negotiation?) SMTP submitters to use TLS on port 587 - leave 25 explicitly blocked by firewall for better security

This question went over poorly on S.F., but as I said there I've managed to find a lot of closely related information, but not an answer truly addressing my question. I am expanding on my homelab ...
MJHd's user avatar
  • 133
2 votes
1 answer
1k views

How can I port forward multiple ports on a single IP address when WAN IP is not accessible outside the country

Thailand (and other countries) have a government sanctioned firewall/gateway(s) which routes all your traffic through it. As a result any LAN ports forwarded to your WAN IP, are available within ...
Rafael Lambelin's user avatar
2 votes
1 answer
759 views

IPTables and SSH login problems when rules are set via a shell script

When I put these IPTables rules, I cannot access to the server via SSH. IPTables rules are not persistent, so I restart the server to have access again. I get this error with these rules when I try to ...
user avatar
2 votes
2 answers
2k views

iptables forward non-local traffic through ssh proxy

I trying to forward traffic from a local port to a remote machine through SSH proxy (not tunnel). I learned, that it can't be done only with iptables rules (please correct me, if it's not true), so I ...
selivik's user avatar
  • 31
2 votes
1 answer
1k views

Load balancing with IPtables

I'm running 2 nginx docker containers on the same EC2 instance in AWS. The containers are using the container port 80. The first container has an IP address 172.17.0.2 and is mapped to port 81 of the ...
Rohan Dsouza's user avatar
2 votes
2 answers
28k views

iptables on Windows10

I'm looking for a way to get iptables functionality in windows 10. I enabled IP routing and I need to forward tcp data to another host (port 4000) and then forward his response while masquerading IP. ...
Marcos Tomassi's user avatar
2 votes
2 answers
2k views

How to route network traffic of a host via another in the same LAN?

So host A (mac OS) has ip: 10.1.10.65 and host B has ip: 10.1.10.68, which is a linux Ubuntu in a virtual machine on host A. I want to route all traffic from host A through host B. What I have done ...
zfgo's user avatar
  • 121
2 votes
1 answer
239 views

Can iptables change its rules based on the network you're currently in?

Does iptables have a way to automatically adapt some of its rules or just straight out switch which rule sets it's using based on what your current network is? I have a lot of uses for something like ...
codykochmann's user avatar
2 votes
1 answer
1k views

Routing traffic between subnets with iptables

I have a KVM virtual machine which is acting as a VPN gateway to a network of other virtual (and eventually physical) machines. I have my hypervisor set up with a tap for each machine and a bridge to ...
PyroAVR's user avatar
  • 131
2 votes
1 answer
836 views

How to forward traffic to a subnet to a remote server with vpn?

Sorry for asking a really generic question, I'm more a developer than a network expert, so please bear with me... :-( My problem is this: I have - server A, serving our REST APIs. - server B, ...
MarcoS's user avatar
  • 151
2 votes
1 answer
1k views

Is it possible to get a total number of packets allowed per second via iptables?

Is there any way to know the number of packets that are being allowed through iptables every second?
Ish Chhabra's user avatar
2 votes
2 answers
199 views

Logging LAN clients using iptables

I placed a raspberry pi acting as a router, to sit between my DSL modem and my internal Netgear wireless router. My thinking was, that I would be able to use iptables to log the connections into and ...
Disco Trader's user avatar
2 votes
1 answer
698 views

Can't connect to FTP site because server actively refused it but WinSCP works

I have a RedHat 7 server that a friend of mine setup, and he is no longer working here with us, so I have taken over. I can connect to the server and transfer files via WinSCP but I cannot connect to ...
RickwhoPrograms's user avatar
2 votes
2 answers
2k views

How to configure on a multi-homed host so Docker containers on a custom network use a specific external IP for outbound traffic?

I have a server (Ubuntu) with two public IPs: the first one is dynamic and the second static. Software run on the server connects to a public internet endpoint which is behind a firewall for ...
murrekatt's user avatar
  • 121
2 votes
1 answer
2k views

iptables -L not showing all rules?

I've added this rule with iptables: iptables -t mangle -I PREROUTING -j TEE --gateway 192.162.122.62 I've checked it with iptables -L or iptables -S but I can't see anything. Is that normal? how can ...
warumus's user avatar
  • 21
2 votes
1 answer
111 views

Do I need this line in my iptables config for redirects?

I have an application listening on port 7162 for SNMP traps. The traps are arriving on port 162 so I have this redirect in my iptables: -A PREROUTING -p udp -m udp --dport 162 -j REDIRECT --to-ports ...
Darren's user avatar
  • 2,742
2 votes
1 answer
10k views

Block ARP requests (or broadcast message, if possible) from A SPECIFIC HOST in a subnet

My ISP provide username-password for authentication and also register the client's MAC address for authentication. I am concerned about someone misusing my connection while I am not using it. ...
Sourav Ghosh's user avatar
2 votes
1 answer
4k views

Policy routing for OpenVPN server & client on the same router?

PROBLEM An OpenVPN server instance (tun, udp, port 1194) is set up on a Linux-based router that also runs an OpenVPN client instance (tun, udp, port 1197) connecting it to a VPN provider. Both the ...
ndvour's user avatar
  • 31
2 votes
1 answer
90 views

Firewall to accept only Wikipedia traffic

I have a challenge where I need to accept only traffic from Wikipedia.org I am familiar with iptables and understand network basics. For Facebook traffic, I could use whois -h whois.radb.net -- '-i ...
M Rusedski's user avatar
2 votes
2 answers
3k views

iptables prevent lan access from another router

I have two Tomato firmware routers setup. Router X is connected to the internet via it's WAN port. The router Y's WAN is connected to router X's LAN1 port. I'd like to restrict router Y so that it ...
Leo's user avatar
  • 23
2 votes
1 answer
987 views

How can I use Ubuntu as a gateway into a remote LAN?

I need to be able to access whole remote subnets from a Windows PC. Here's my network layout: I -{MyLAN: 10.77.77.0/24, DHCP}--[Ethernet: 10.77.77.64] N (Windows 10 ...
Mihail Malostanidis's user avatar
2 votes
1 answer
21k views

TCP connect: No route to host

I started a tcp server on a host A and then start a tcp client on another host B. Both hosts are in the same LAN via the wireless router at home. the tcp client tries to connect to tcp server on port ...
lily's user avatar
  • 1,835
2 votes
1 answer
7k views

OpenVPN without NAT

I'm trying to figure out how to route OpenVPN clients without using NAT/PAT. What I want to do is to route the IP address that they are assigned when clients authenticate to the OpenVPN server to the ...
jjmil03's user avatar
  • 21
2 votes
1 answer
713 views

Netfilter/tc rule to separate SSH and SFTP traffic?

When I connect to my server (RasPI 2 with Raspbian) remotely, I want my interactive SSH sessions to always have priority over any running SFTP sessions. Also, SFTP sessions should have less priority ...
ris8_allo_zen0's user avatar
2 votes
1 answer
5k views

Man in the middle using iptables

I wish to test a subsystems which communicates with another subsystems via tcp. I have used the following: "iptables -A OUTPUT -p tcp --dport "+port_number" -j DROP" to stop the traffic on a port so ...
Baz's user avatar
  • 489
2 votes
1 answer
1k views

tcpdump capturing packets only when interface is specified

I have tried 3 different ways of capturing a stream of packets coming into my server. Two of them work and the third does not. I am trying to determine why it is missed by the third approach: ...
Pace's user avatar
  • 131
2 votes
1 answer
480 views

Most secure way to have IPtables auto-loaded using Debian / Linux

I'd like to know the safest way to load iptables using Debian. Of course, I can use a script that uses iptables-restore : #!/bin/sh iptables-restore < /etc/firewall.conf but : 1) where is the ...
networkIT's user avatar
2 votes
3 answers
556 views

outgoing ssh fails from only one machine on lan to outside network

I have multiple servers in my LAN (which I'll refer to as Box1), and they are all able to make outgoing SSH connections, except one that stopped recently, which I'll refer to as Box2 (actually, I'm ...
Reese's user avatar
  • 172
2 votes
1 answer
969 views

When writing an iptables save file by hand, how does one calculate the packet-counter and byte-counter values?

I am attempting to write a 22MB iptables rule-set file, the very kind that is generated with the iptables-save command, except endlessly long. Understandably, this takes a prohibitive amount of time. ...
ca2longoria's user avatar
2 votes
2 answers
6k views

How to route specific traffic through OpenVPN?

I'm running a server at home with rtorrent and apache2. I would like to route my rtorrent traffic via OpenVPN and since im kinda new to OpenVPN and iptables i would like to have a user friendly guide. ...
junkyhlm's user avatar
2 votes
1 answer
2k views

iptables FORWARD rule

I'm running 3 virtual machines with Fedora 19. The machine B is set up with two networks adapters and provides que channel between machine A and machine C. The machine A IP is set to 192.168.1.1 and ...
Favolas's user avatar
  • 167
2 votes
1 answer
2k views

IPTables - unknown error 4294967295

I've moved an old Slackware 11 installation from a physical PC to a virtualized in ESXi. Everything seems to work fine except for one rule in iptables, namely the row: iptables -t filter -I INPUT -m ...
Zyberzero's user avatar
  • 191
2 votes
1 answer
2k views

How to route specific traffic through OpenVPN?

I'm running a server at home with rtorrent and apache2. I would like to route my rtorrent traffic via OpenVPN and since im kinda new to OpenVPN and iptables i would like to have a user friendly guide. ...
junkyhlm's user avatar
2 votes
2 answers
4k views

iptables port based routing

I've been Googling this for days with no success. I connect to a VPN from my server from time to time and I'm trying to configure my Debian server to only use port 80 and 443 through the VPN and all ...
Arya's user avatar
  • 497

1
5 6
7
8 9
39