Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
9 views

Block or rerouting IP

There is an IP that connects to my phone (galaxy note 5 running android 7.0) and collects too much data i don't like it but blocking it with host or router doesn't work I need to block or at least ...
1
vote
0answers
8 views

Traffic routing not working between IP and interface

The debian server is configured like this: enp0s8 = WAN enp0s10 = LAN (Internet via tun0) enp0s12 = LAN access only, no internet available tun0 = Main VPN Connection tun1 = Secondary VPN Connection ...
1
vote
0answers
15 views

Keepalived not routing certain tcp packets

I am trying to implement a NAT based keepalived load balancer for our outgoing squid proxies. I have set up 2 keepalived VMs which share a VIP: [root@keepalived-01 ~]# ip a 1: lo: <LOOPBACK,UP,...
0
votes
0answers
23 views

How to connecte local network web server with my global ip address from behind nat

When I connect my web server from the internet, I can connect to my webserver with other global IP address. but when I connect from Desktop PC(192.168.0.3) to Web server, web server appends "192.168....
0
votes
0answers
16 views

Iptables rules seem to be missing packets?

On my home network (192.168.1.0/24), I am trying to use iptables to silently clone all wifi TCP/UDP traffic to/from my Xbox One to my Windows 10 desktop, for packet sniffing via Wireshark. Due to ...
0
votes
0answers
15 views

Properly block ports on openwrt

I want to block certain protocols to be used, and I do this by blocking their ports such as 53. I tried to edit /etc/config/firewall adding: config rule 'stopdns' option name 'stopdns' ...
0
votes
0answers
5 views

Android 9 - IP forwarding [closed]

Apparently after updating my device to android 9 ip forwarding now seems to be an issue. Packets aren’t being forwarded. Before on android 8, I’d simply run “sysctl -w net.ipv4.ip_forward = 1” and ...
1
vote
1answer
9 views

How can I make port rerouting work locally?

Behold this command: iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 I use that to reroute any incoming traffic from 80 to 8080, because the Apache 2 server on that ...
0
votes
1answer
15 views

How can I configure firewalld to block all outgoing traffic except for specific ports while allowing localhost to access any of its own local ports?

I'll confess at the start that I'm asking this question only after finding the answer and wanting to share it with everyone else. If this is bad form, then my sincere apologies and I'm open to the ...
0
votes
1answer
19 views

openvpn is blocking external request to webserver and ssh

My setup: Raspberry pi 3 OS: raspbian 9 (stretch) local network (eth0): 192.168.0.X wireless network(wlan0): 192.168.10.X This setup is behind a modem/router which provides access to the internet. ...
0
votes
2answers
52 views

Implementing an OpenVPN “kill switch” with iptables

I'm trying to implement a set of iptables rules for OpenVPN: Everything (without exception) goes through OpenVPN If OpenVPN is down or inaccessible everything (without exception) cannot access the ...
0
votes
0answers
17 views

dhcp / iptables: Evil Twin gives wifi but does not send user to my website

So I set up an Evil Twin AP and when a user connects, it transmits wifi data and all of that but it does not initally send the user to my fake website on apache2 localhost port 80. Here are my configs:...
1
vote
0answers
13 views

understanding iptables filtering on two virtualbox guests

I have 2 virtualbox guests, each with ONLY an internal network (192.168.68.0/24). They can ping each other, and tcpdump shows no other traffic on the only interfaces (enp0s8) active on both boxes. I ...
-2
votes
0answers
23 views

Iptables port fowarding

Im trying to access this ipaddress thru the public ipaddress using iptables brvlan27 10.0.0.1 i can connect to this ipaddress thru brvlan27 172.0.0.2 brvlan07 192.168.1.1 ppp0.962 Link encap:...
0
votes
0answers
44 views

OpenWRT - Default configuration does not work

I finally got to try get OpenWRT working on a router, sadly it seems it's more toil than it's worth. I have installed OpenWRT on TP-LINK 1043ND v1. OpenWRT Version: OpenWrt 18.06.1, r7258-...
1
vote
1answer
49 views

Drop one packet from stream

I'm searching for a way to drop one packet of (UDP) multicast stream. Is this possible by userspace utilities or the only way would be injecting some code to kernel IP stack? I expect it should ...
0
votes
1answer
33 views

Maintaining source IP while forwarding port from one host to another, but there is a small issue

I am using this tunnel approach: https://superuser.com/a/1357450/972858 to forward a port N from x.x.x.x to y.y.y.y. Its working perfectly and destination y.y.y.y is able to see the actual source IP ...
0
votes
1answer
20 views

Can't forward internet via to wlan via eth | iptables restore command not working

I have a NanoPi M1 Plus device with Ubuntu OS in it which I am using it as a router. The device is getting the internet via ethernet cable (eth0 interface) and the WiFi AP is provided via interface ...
0
votes
0answers
37 views

Redirect all traffic to one page on webserver Raspberry PI AP

I am currently trying to get iptables working on my Raspberry PI. But for some reason they won't work. This is the content of my /etc/iptables/rules.v4 file. Generated by iptables-save v1.6.0 on Wed ...
0
votes
1answer
24 views

iptables - Redirect local and transient outbound traffic destined for port 80 to port 8080

I'm having an issue with iptables due to my very small amounts of involvement with it. I have a TOR exit relay setup and I'm trying to redirect all local and TOR traffic so that it exits my box on ...
-1
votes
1answer
19 views

iptables block but then allow to same destination

I have a RaspberryPi on my LAN with default policies of DENY for in/out/forward. I want to open outgoing to four IP-addresses and allow responses to come back, but not accept new connections from ...
1
vote
1answer
98 views

iptables “Bad argument `MASQUERADE'”

I am trying to create an "evil twin" access point for myself in Kali Linux with VirtualBo. I'm trying to get my iPhone to connect and be rerouted to a fake "terms of service" page. Here is what I am ...
0
votes
1answer
69 views

How to prefer communication in the local subnet using IPv6 ULA instead of IPv6 GUA?

all my devices own IPv4, IPv6 LL, IPv6 ULA and IPv6 GUA adresses like this: 3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 88:b1:11:...
0
votes
0answers
46 views

How is pmtu determined when we clamp-mss-to-pmtu using iptables?

I have the following entry in iptables. iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu I understand that it is limiting the maximum mss for TCP to pmtu as ...
-1
votes
1answer
23 views

IPTables Ignoring Rule To Redirect Web Traffic

I am trying to do something very simple. I am trying to force all web request to go to my local webserver. I start by activating said webserver on my Kali Linux VirtualBox machine sudo systemctl ...
1
vote
0answers
14 views

Give access to CloudFlare IPs in iptables

I trying to DROP all requests except CloudFlare requests, and give SSH access to a certain ip. so I write this rules : iptables -P INPUT DROP iptables -P OUTPUT ACCEPT iptables -P FORWARD DROP ...
0
votes
0answers
13 views

NAT Traffic From ppp0 to other interface

I have a debian server with strongswan running with a L2tpd vpn server running. I also have another tap interface on that server. When I dial my vpn I get a 192.168.42.x address. I want to be able ...
0
votes
1answer
25 views

Disable root access to iptables. It is possible to disable root user

It is possible to disable root user to change iptables rules or anything do with iptables, allowing to change rules for another user?
0
votes
0answers
33 views

iptable_nat stopped working after update

Today, I installed some updates with dnf update. After that I cant set some basic iptables rules. $ iptables -A INPUT --match state --state ESTABLISHED,RELATED --jump ACCEPT` iptables: No chain/...
0
votes
1answer
56 views

iptables rule for incoming from certain ip and port

I have 2 servers, one for web requests (I named it the web) and another one is for database (I named it the db). Both servers are CentOS 7. I want to make these rules in iptables: all request to db ...
0
votes
0answers
75 views

Centos routing between two lans

I have two lans (192.168.1.x (MSWindows) & 192.168.2.x (Linux) ), each with its own NAT gateway and (external) Inet connection. I route between the two locally with a Centos 6 system which has ...
-1
votes
0answers
21 views

How to setup subnet that is not connected to main VPN subnet on Tomato router?

I am trying to setup a subnet on my advanced Tomato router that is not connected to the VPN client I run network wide.. So subnet 192.168.2.1 for example is not connected to the VPN in anyway and any ...
0
votes
2answers
82 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 ...
1
vote
1answer
144 views

Share VPN connection over Ethernet

I'm trying to setup and old pc with linux (CentOS) as an access point to a VPN I have in another home. I have two ethernet interfaces, so I want to use one to connect to internet through my router, ...
0
votes
0answers
59 views

VMware and Linux

I have the following problem: I need to connect the virtual machine (windows 7) to my host(Ubuntu): My host Ubuntu have internet access. Ubuntu must as act a gateway of windows 7. Windows 7 VM must ...
0
votes
1answer
60 views

How to delete multiple lines of the IPTABLES

Is there a way to delete multiple lines in an iptables not knowing what is in my iptables? For example, I want to delete every port forwarding from port 80 and here is the iptables: Chain ...
0
votes
0answers
18 views

fedora 26 disable firewalld use iptables startup script

the firewalld zones and rules etc are a complete pain in the butt compared to regular old iptables. My main goal is to get my iptables rules to run at startup and not have to recreate them all with ...
0
votes
0answers
37 views

Client of hostapd could not ping gateway

I have a laptop with Intel 8260 wireless module. And I ran following commands to make it a wireless router. Now the testing client can connect to my SSID, and get a DHCP address, both verified from ...
0
votes
1answer
39 views

Forwarding external traffic through LAN

I am trying to forward network traffic through a wireguard VPN into a VM running on another host. All that - while preserving original source IP address in order to achieve transparent proxying. Both ...
0
votes
1answer
34 views

How do I reroute traffic from port 80 on tun0 to port 80 on eth0?

I have a webserver running on the same server that I use a VPN on. I'd like to be able to access the webserver when the VPN is both on or off. On FreeBSD this was pretty simple, in my opinion PF is ...
0
votes
0answers
68 views

Packets not forwarded by linux bridge

I have a VM (VM1) with one interface (eth0). VM1 has one linux bridge (br1) and the interface eth0 is connected to it. Through eth0, packets with two different ip ranges will arrive (192.168.122.0/24 ...
0
votes
1answer
42 views

LINUX Routing VPN traffic for specific port to host on local network

I am connecting my Linux L1 to VPN to get a public static IP 117.xxx.xxx.xxx . This L1 machine has only one ethernet interface eth0 with ip 192.168.1.130 and VPN is connected creating interface ppp0. ...
2
votes
1answer
23 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 ...
2
votes
2answers
57 views

How to find all the Iptables rules on port 80

I was wondering is there a command to list / find all the iptables' rules on port 80 (or any other port)? For example something like this: iptables --list | grep port 80
0
votes
0answers
122 views

How do I block Windows 10 Guest VM from updating itself Linux Mint Host

I have windows 10 running as a guest OS in Virtual Box. As you know, this virus of an OS updates itself automatically and you can't disable this. How can I block the windows update servers from my ...
0
votes
0answers
28 views

Port forward from eth0 (IP camera is connected to eth0) to wlan0 in same board

I have a Cisco SG500 switch where I have connected my IP camera to eth0. I need to port forward from eth0 to wlan0 on this same board such that if I login to my board via wlan0, I should be able to ...
2
votes
1answer
33 views

How can I take all traffic destined for a certain port, from any IP to any IP, and redirect it to the local machine, preserving the source IP?

I want to take all traffic, from any IP address to any IP address, originating on interface enp4s5, destined for port 80, and redirect it to the local machine (the router that iptables is running on). ...
1
vote
1answer
16 views

Iptables rules depending on network connected to

I've struggling around something I would like to put in place. I use my ubuntu 18.04 laptop at work and at home. I would like my iptables to drop all incoming connections (except established ones of ...
2
votes
1answer
64 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 ...
0
votes
0answers
21 views

“Bouncing” an openVPN connection through/over/across another host

One of the locations I work from/at is blocking all traffic to "commonly known" VPN services, including the VPN service I use. I would now like to "bounce" the openVPN traffic through/across/over my ...