Stack Exchange Network

Stack Exchange network consists of 175 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-redirect]

The tag has no usage guidance.

0
votes
0answers
25 views

IPTables and Port Forwarding on an OpenVPNAS Server

I have a new OpenVPNas server running on CentOS 7 (Not married to CentOS 7). That I working on replacing an expensive Commercial VPN that has a Public Static IP. Being that the OpenVPNas server is ...
0
votes
0answers
78 views

Port forwarding in Linux for UDP doesn't work

I'm trying to apply a port forward rule to forward UDP traffic from my AP on port 53 to a custom DNS server listening to 9053. I tried various calls. None of them worked. I've tried this in Kali. ...
0
votes
1answer
243 views

Forward all traffic to a socks5 proxy port

I followed this answer: Redirect all non-local traffic to a socks proxy root@xxx:~# cat /proc/sys/net/ipv4/ip_forward 1 root@xxx:~# netstat -tapln | grep :4545 | grep LISTEN tcp 0 0 127....
0
votes
0answers
133 views

Redirecting UDP to local port the reply packet isn't SNATed, w/ iptables

I ran dnscrypt-proxy or tor on Linux listning on [::]:1053 to server DNS. I wanted to make all my Linux host's DNS queries transparently use that proxy. This is what I found from Internet how we ...
0
votes
0answers
94 views

Transparently redirect all incoming traffic from wifi hotspot to specific port?

I am using my laptop as a wifi hotspot to share my internet connection with other devices. My internet connection goes out through a socks proxy. In my laptop I configured redsocks to redirect all ...
3
votes
0answers
194 views

Change destination of TEE'd packets

Because of reasons I can't go into here, I found myself having to duplicate a UDP packet stream (netflow data, if it matters) to a second destination. After some research, I discovered that the TEE ...
0
votes
2answers
635 views

Local port forwarding using iptables is not working

I am using the following command to forward incoming traffic from port 30 to port 1234. But it's not working. In Wireshark also there is no trace of packets directing to port 1234 are found. sudo ...
1
vote
2answers
145 views

Use the LANs of one server to access the LAN of another

I'm a bit lost here, so I'm asking for your help. =D I have three servers: 1# - LANs A and B 2# - LANs B and C 3# - LANs C and D How can I make server 1# access through LAN B an ip that is in LAN D ...
0
votes
1answer
59 views

iptables localhost redirect just echoes

I am trying to redirect traffic coming from the Internet into an SSH tunnel on localhost with iptables, on port 2025. For some reason the redirect doesn't work. I connected to it with telnet and it ...
0
votes
1answer
342 views

Redirect all incoming and outgoing traffic from a port to a specific ip

I am running a node server inside a docker container on port 8080 and i can access it via 172.17.0.2:8080 (container ip) now i want to access this ip from localhost:9099. I have tried using iptables ...
1
vote
0answers
22 views

Strange behaviour of (D)NAT

I'm trying to forward all icmp requests from source ip 5.10.13.13 to new destination ip 5.10.11.11. IP of current local machine, where i'm applying iptables rule is 5.10.10.10. I apply this rule: ...
0
votes
1answer
190 views

How to setup ipables to redirect ports when the linux server has two IP addresses [closed]

I want my Glassfish webserver to serve web pages for two distinct IP addresses. What I am trying to do is to setup iptable rules to translate the ports. for IP #1 198.xxx.xxx.14:80 <-- ...
1
vote
2answers
71 views

Maintain destination port of TCP packets after leaving through another local port

problem: I have an application sitting on a host (let's call it host1) that sends TLS-encrypted TCP packets to another host's port 5015 (let's call it host2). Due to network restrictions, the host1 ...
1
vote
1answer
640 views

How to Redirect marked packets on multiple ports to one IP Address

I have set up this rule: -A PREROUTING -i vboxnet0 -p tcp -m tcp --dport 80 -j internet -A internet -j MARK --set-xmark 0x63/0xffffffff To capture incoming traffic on port 80 and send it to be ...
1
vote
1answer
1k views

iptables: transparent tcp traffic proxy

problem: I have a TCP server and client that each listen on port 9000. I have the server and client deployed on two different hosts where traffic can only pass through port 80 between them. I want ...
5
votes
1answer
2k views

What does iptables -j REDIRECT *actually* do to packet headers?

Out of curiosity I'm reading some tutorials about transparent TOR proxies as it's quite interesting topic from a networking standpoint. As opposed to VPN gateways which just use tun/tap interfaces and ...
0
votes
1answer
232 views

Iptables not working as I expect: response package not DNATed as expected with DNAT in PREROUTING

My server (on which bellow iptables rules are loaded) has the IP 192.168.3.110. There is another computer in my LAN with IP 192.168.3.106. I'm trying to redirect requests to my server on port 80 to ...
1
vote
1answer
40 views

Linux Router for One Application using iptables

I have 3 machines: Router 192.168.229.4 Server 192.168.229.2 Client 192.168.229.3 on the server there is a TCP file server running on port 1234. I want to redirect all the client-server-client ...
1
vote
0answers
310 views

Squid + Squidguard - redirect http traffic

Im having trouble figuring out which is the best way to redirect the traffic for a certain subnet. Basically i want to deny the access for a certain subnet to the internet. And i want it to always ...
1
vote
0answers
82 views

Iptables port hijacking

I have an application listening on port 2000. I want to proxy all traffic to this port (originating locally) to a different port, say 4000. Right now i am doing something like this. iptables -t nat -...
2
votes
0answers
112 views

Solus traffic flow

We install Solus in our host machines and run several containers. I've noted that after installation, solus modify iptables adding to Forward chain Solus_in and Solus_out. In those chains he is adding ...
2
votes
0answers
490 views

iptables rules for two different lxc containers

I'm running two lxc containers onto a VPS machine and being new in iptables area Im trying to create rules to forward external traffic into containers. The first one (192.168.1.2) is running an ...
0
votes
1answer
396 views

Redirecting subnet traffic to a different gateway

I have a Debian Jessie box at 192.168.1.5 connected to the router (at 192.168.1.1) running an OpenVPN client (it's actually a Pi using this setup. The only part different is that the Pi's eth0 IP is ...
0
votes
1answer
45 views

Setting up a development environment with Iptables

I am trying to set up a development environment and all my applications are divided in two parts. The ReactJS front-end is accessed at http://127.0.0.1:3000 and the Ruby back-end is at http://127.0.0....
2
votes
0answers
354 views

Temporary DNS resolve to local ip (for temporary http redirect)

So here is my high level goal: I have Linux running on a small device that acts as a Wifi-Hotspot for wireless clients. It also runs a web server (nginx) for configuration and I would like to ...
1
vote
1answer
2k views

How can I redirect outbound traffic to another ip using iptables

I have server1 (192.168.0.1:8080) and server2 (192.168.0.2:8765). I need to redirect OUTBOUND traffic from server1 port 8080 to server2 with iptables. On server1 I set: echo 1 > /proc/sys/net/...
3
votes
1answer
1k views

IPTables redirect all UDP packets including ESTABLISHED

We currently have some rules setup in IPtables that look like the below: -A PREROUTING -d dstip/32 -p udp -m udp --dport 27035 -m u32 --u32 "0x0>>0x16&0x3c@0x8=0xffffffff&&0x0>&...
0
votes
1answer
450 views

How can I redirect http traffic to an absolute link path with iptables

I'm trying to redirect a host to a specific link on my network when they try to browse through http. The ip of the host I'm trying to redirect is 192.168.2.19 and my web-server is on 192.168.2.15:6969/...
2
votes
0answers
229 views

Redirection of traffic from one computer to another

I have two computers on the same lan Comp A: 192.1681.151.15 Comp B: 192.1681.151.19 When I open Wireshark, for all traffic browsed on comp A, I would like Wireshark to capture traffic of comp A and ...
0
votes
0answers
400 views

iptables traffic redirecting going wrong - UDP forwarding from proxy

good evening! I have a proxy running HAProxy and iptables in my network (and that proxy is behind another firewall and NAT). So far, I've been doing only TCP redirects to servers using HAProxy, and ...
1
vote
0answers
543 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 ...
4
votes
1answer
2k views

How to redirect web traffic to specific host with iptables

I want to be able to redirect a host in my Lan to an specific ip address and port. I can achieve one thing which is that only my desired host can access the ip address, but I can't get the user to ...
4
votes
0answers
1k 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 ->...
1
vote
1answer
295 views

Redirect the traffic of one port to one chain with iptable?

On the raspberry Pi, I install the privoxy and a socks proxy software. I want to redirect all the traffic to the chain REDSOCKS_FILTER. The traffic of tcp protocol of port 80 from all the traffic ...
0
votes
2answers
842 views

Is it possible to redirect a local port to a LAN port?

I'm using a Flask application with virtual environment. When I start the server, I can access it locally via the IP 127.0.0.1:5000, but I'd like to make it accessible on my WLAN (pointing at 10.0.0.1:...
1
vote
0answers
102 views

Alter DST port on bridged traffic

I need to rewrite the UDP destination port on traffic which is only bridged/L2, but I could not match this traffic via iptables. This traffic isn't going through NAT chains (it could be matched in ...
0
votes
2answers
577 views

iptables rules apply with delay

I'm using iptables to block Internet (by redirecting to an internal server) access on devices connected to my hotspot. That's my command: iptables -t nat -I PREROUTING -p tcp -s 192.168.43.51 -j DNAT ...
4
votes
0answers
886 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 TL-WN821N ...
0
votes
0answers
837 views

Use iptables to redirect **all* requests, even DNS-unsolved domain?

Context: With iptables, I redirect all the traffic - incoming at port 80 - to a distant server IP (X.X.X.X). I aim that anywhat you write in the urlbar of browser, you get X.X.X.X. IP That works a ...
0
votes
1answer
579 views

Apache VirtualHost redirect 302 (cyclic link)

I seek some wisdom, so please help... I have one VM acting as router/web server/dnsmasq server on IP: 192.168.100.1. And I have other machine acting as client. Server has IPTables rule to redirect ...