Questions tagged [iptables]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Google Cloud IKEv2 VPN on Ubuntu Compute Engine VPS

As I stated in the title, I am installing the strongSwan and configure the IKEV2 VPN on the VPS. But, as you know, GCP has its firewall rules, which I am not familiar with that. I am using this ...
0
votes
1answer
15 views

openvpn restricting clients from accessing certain IP's in internet with ufw

I'am looking for a solution which can block openvpn clients in accessing certain website(ip's) in internet, i tried ufw rules like below , but doesnt seems to work from client, what piece do i miss? ...
0
votes
0answers
9 views

Port Forwarding to Squid Port iptables

I have binded a few IPs to my server and I am having trouble forwarding them to the port that Squid is listening on. I am trying to open a random port and assign it to the IP and then forward it to ...
0
votes
0answers
9 views

How to port-forward internal host to VPN

I've run into a bit of a puzzle and haven't had much luck finding a solution. I'm trying to set up a VPN connection, where multiple remote hosts would be able to access a single application within my ...
0
votes
0answers
6 views

Blocking everything from sending mail except postfix

How could I use iptables to block anything except the Postfix user from sending mail? It would be useful in case a web app such as wordpress got infected with malware and started sending spam. We ...
0
votes
1answer
32 views

Connect from WAN while OpenVPN Client connection is active

I've been trying to get this working for a while now, but still unsuccessfully. I hope you will be able to help me with it. I've got machine (Raspberry Pi), which has: Static local IP: 192.168.1.131 ...
0
votes
1answer
17 views

How to use IPTables to keep a running total of the amount of data passed to and from a single IP?

I need to keep a running total of the number of bytes passed between my server and a remote server (port unspecific). I would like to keep this running total written in a file. I'm a bit new to ...
0
votes
1answer
20 views

iptables: host/network not found with multiple sources and destinations

When I try to run this command: iptables -A FORWARD -p tcp --dport 22 -s 1.2.4.0/24,9.2.3.0/24 -d 1.2.3.1,1.2.3.2 -j ACCEPT I get this error: iptables v1.4.1.1: host/network `1.2.4.0/24,9.2.3.0' ...
-3
votes
1answer
38 views

How to hack proof my syslog-ng server

I recently built a Ubuntu syslog-ng server that is behind a firewall. I have opened TCP ports 514, 515, and 516. I have noticed that hackers are writing to my syslog-ng server, they are from China. ...
0
votes
1answer
16 views

Routing and packet mangling

I’m looking to get packets from one subnet to another more than one hop away; take for example: [ 192.168.0.4 ] - - - > [ 192.168.10.11 ] - - - > [ 172.23.100.13 ] I would like 192.168.0.4 to ...
1
vote
3answers
138 views

Permanent IP block with iptables after first connection to port

All my servers are running SSH on non standard port (987) and I want to permanent block all IPs that try to connect to port 22. I have now the rule iptables -A INPUT -p tcp -m tcp --dport 22 -m state ...
0
votes
0answers
11 views

How do I access a printer when routing through a vpn gateway

I have a couple of Unifi networks with DHCP 192.168.1.0/24(VLAN 0), GW 192.168.1.1 192.168.30.1/24(VLAN 30), GW 192.168.30.1 I can connect to any clients across these different subnets fine when NOT ...
0
votes
0answers
31 views

Centos Forwardind by portfwd

I have Centos 7 I used portfwd to forwarding incoming connections form my centos 7 server to windows game server, But the Centos 7 server does not receive the connection from the Windows game server "...
0
votes
0answers
10 views

Restoring default iptable rules after complete wipeout

I am a complete newbie who just accidentally erased all their desktop's iptable chains and rules and wants to restore them all to the previous default (docker nor bootstraps work now as they cannot ...
0
votes
1answer
537 views

Which port should you left open for inbound and outbound for other Linux services to work properly?

I am going to deploy a docker swarm (3 node: 1 manager 'frontend', 2 worker 'backend and db') with Security Groups for the VPC. I am planning to deny all inbound/outbound connection from the start. ...
0
votes
2answers
38 views

CentOS 7 Forward port to another IP:PORT

I have CentOS 7 that uses IPTABLES for Forwarding port 30120 to windows server For example : Windows games server IP: 192.168.1.3 Linux Centos 7 server IP : 192.168.1.5 iptables -t nat -A PREROUTING ...
1
vote
2answers
42 views

Cannot access into my server after running iptables-restore. How to revert this command

I decided to run this command iptables-save | tee iptables_backup.conf | grep -v '\-A' but instead I accidentally put an extra command iptables-restore and ran this and now my server is locked. I ...
0
votes
0answers
12 views

Latency introduced when reloading HAProxy every 15 seconds

We have a use case in which we need to reload HAP every 15 seconds. For every reload, the latency shoots up to 12ms. Normal latency is 7ms at 32k req/s. Below is what I have tried - On the same host,...
0
votes
0answers
13 views

OpenVPN fw traffic to subnet

I'm trying to reach the .27 subnet from the following config: open-vpn server.conf ......... route 192.168.27.0 255.255.255.0 push "route 192.168.27.0 255.255.255.0" ......... client ip: 10.8.0.27 ...
0
votes
0answers
17 views

DNS in HA with Nginx & iptables

I have two DNS servers dns1 & dns2 and I want to do failover load balancing between the two. I'm using Nginx as load balancer to dispatch DNS request to the authority servers. Clients --> ...
0
votes
0answers
19 views

Forwarding Home Game-Server through GRE Tunnel | Can't ping remote GRE IPs

I am having trouble routing my game-servers through GRE. I do not receive a ping from either side when pinging them. I can ping the local GRE interface; however, I cannot ping the remote GRE interface....
1
vote
0answers
9 views

OpenVPN Connection to server with 2 gateways

I have problem with routing (i think it's routing) on Debian server. I got 2 routers working as gateways (one of them is public). VPN Clients conecting to Router1 but getting TLS Handshake because of ...
0
votes
1answer
29 views

iptables: allow everything that aims towards nginx

my router has a port forwarding from port 80 to 8080 to a linux server. On port 8080 there is nginx listening and acting as a reverse proxy. Nginx can redirect to another port on the same machine. (...
0
votes
0answers
19 views

iptables: Block internet, but allow local connections

I got myself a VPN account and want to ensure that everything is using the VPN connection. So I started with iptables and decided to block everything except for the tun0 network device. Immediately ...
0
votes
1answer
49 views

Do I have the right IpTables here? I cannot send but I can receive

Setting up a mailserver and I've taken steps to secure it. One of the steps is to have a set of IPTABLES rules From you can see, I've set all the policies to DROP, even the OUTPUT, I think that's ...
0
votes
1answer
23 views

Routing(forwarding) all traffic based on source/destination (Linux/CentOS)

I have an active-active Linux router (running CentOS) with three interfaces (ens100, ens101, ens102). I use iptables to route traffic. My problem is with connections between "Server A" and "Server B"...
1
vote
1answer
34 views

iptables for modifying tcpmss value

I have a VPN router, and i need to lower TCP MSS value for traffic going through. I am confused about which iptables table is needed to do the job. I lean towards the mangle/forward combination - ...
0
votes
0answers
42 views

Need help routing smtp from internal mail server over external VPS

I have a public vps that serves as a frontend for a server locally hosted in house. These are connected over a vpn hosted by another server in my network. Atm I managed to route web traffic and ...
0
votes
0answers
16 views

Can I still add firewall rules on command line if I use webmin

Was wondering what is the relationship between Wembin->Networking->Linux firewall and adding firewall rules using the command line. I ask this as I want to add a firewall rule like iptables -t nat -...
0
votes
0answers
20 views

fail2ban finding, also listing but not banning

I am new to fail2ban, but I managed to set up a new filter my-botsearch (from https://github.com/fail2ban/fail2ban/blob/master/config/filter.d/apache-badbots.conf) I adopted the regex a bit to match ...
0
votes
0answers
12 views

Routing to a pair of active redundant openvpn tunnels so that periodically the 'main tunnel' can be switched over for all new connections

I have a network the following basic architecture: 1) clients connect via openvpn, coming in on a single subnet (10.10.10.0/24) 2) If the client's ultimate destination is the Internet, there are a ...
1
vote
2answers
58 views

How can a server accept incoming traffic to port 443 if it isn't listed in netstat?

I have a server that is currently accepting HTTPS requests and the only thing that shows with netstat -plnt is this: elijahlynn@web:~$ sudo netstat -plnt Active Internet connections (only servers) ...
0
votes
0answers
13 views

URL and port redirect nginx

I'm running web app in AWS EC2 from an snap at: (http://) myurl.com:3001 I installed nginx to redirect port 80 to 443 and 3001 to 443, so the url to the user becomes: myurl.com (with (https://) at ...
0
votes
0answers
7 views

How to create an iptables groups which will have a list of address and then set access for that group?

I have an openvpn server which manages connection between instances with iptables. I need to create an iptables group (lets call it "SUPER") which will have a list of all the address I want. Then I ...
2
votes
1answer
43 views

rasbian - iptables `--to` or `--to-destination` unknown option

I'm trying to run the following commmand on my Raspbian system sudo iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 2222 -j DNAT --to-destination 192.168.2.241:22 iptables says: iptables v1.8....
0
votes
0answers
11 views

Converting an iptables rule to Windows Server Firewall

anyone knows how to write the equivalent of this rule in Windows firewall? iptables -t nat -A POSTROUTING --destination 0.0.0.0/0 -j SNAT --to <IP>
1
vote
0answers
35 views

NAT with strongswan - howto?

Network Topology I have the following setup where Office 1 and Office 2 have the same IP address range (192.168.0.0/16) and both are using strongSwan running on Ubuntu VM (with two NICs one connected ...
0
votes
1answer
41 views

strongSwan client can connect to the internet (through the VPN) but cannot SSH to VPN server or other clients on the VPN subnet

I wrote a strongSwan guide a while back which I followed. I then installed isc-dhcp-server and configured strongSwan for DHCP. Everything works fine except clients cannot SSH to the VPN server or ...
0
votes
0answers
19 views

iptables: setting specific rules to IP aliases

We run several game servers all using one port with the use of IP Aliasing, the game servers bind to a specific aliased IP that belongs to the main dedicated server. I've setup netplan already and it ...
0
votes
0answers
20 views

How do I open a port in the firewall only for the private IP and not for the public IP?

I currently have a Linode which is configured with both a public internet facing IP, and a private internal datacenter IP which connects the servers over a private LAN. I want to open up a port on ...
-1
votes
0answers
12 views

Ports used by LTE/3G on Android

I just discovered that a 3G/LTE connection on my phone, circumvents my iptables rules which I have for some apps, for example: sh -c 'iptables -I OUTPUT -m owner --uid-owner 10090 -p tcp --dport 80 -...
0
votes
0answers
95 views

Proper UFW rules for webserver being tunneled through Openvpn Server on EC2 instance

I have configured a webserver locally. I am running an Ubuntu 18.04 EC2 instance which is configured as an openvpn server. My webserver is successfully connecting/tunneling to my OpenVPN Ubuntu server ...
0
votes
0answers
27 views

Traffic redirection to a container

I have a tunnel interface tunl0 with few IP addresses, in the same host, there is a container. The container has an interface eth0 and many IP addresses in it. Each IP in the eth0 interface of the ...
1
vote
0answers
20 views

Docker container on host with two NICs connected to internet

I'm running a docker container with port 6882 exposed on a host with two NICs. Each NIC is connected to a router with a public IP address. How can I allow my docker to be reached through both public ...
0
votes
0answers
18 views

Can not redirect traffic with iptables in MITM

i've been trying to make a MITM attack with Kali linux and a smartphone, using the mitmproxy tool. echo 1 > /proc/sys/net/ipv4/ip_forward arpspoof -i wlan0 -t {smartphone_ip} -r {route_ip} Then I ...
0
votes
0answers
31 views

Howto configure Wireguard on Linux router to route all traffic from LAN to remote wireguard VPN server

I've an Armbian linux on a NanoPi R1 running. It routes all traffic from eth1 (LAN static IP, dnsmasq for DHCP/DNS) to eth0 (WAN dhcp-client) via IPTables NAT/Masquerading. That works fine. A client ...
0
votes
1answer
34 views

Ufw and Iptables. Which is better and why? [closed]

I am a newbie to this domain, so i kept researching on ufw and iptables. But I cant distinguish them clearly because in every article /blog both of these names are present and I am really confused ...
0
votes
0answers
20 views

proxy-mode configuration for AKS for even load distribution across pods

I have a managed AKS cluster on which i have configured 3 pods to be used as a mock processor (they just receive the request and hold for 15 seconds before returning response) service. Along with that ...
0
votes
0answers
40 views

Why my nextcloud doesn't request with iptables enabled?

I have installed nextcloud in a server with TLS. Your installation was successed. In my server, the iptables is enabled and configured, following: Chain INPUT (policy DROP) target prot opt ...
0
votes
0answers
21 views

OpenVPN use the Alias Ip for outgoing Traffic [Debian 10]

I have an OpenVPN server to which I can connect using the alias IP. However, if i check what the IP address is, the main IP of the server is shown, so I was wondering how i can change that so the ...

1
2 3 4 5
114