0
votes
1answer
40 views

Linux iptables DNAT 53306 to 127.0.0.1 3306

mysql real port is 3306。 I want public network using 53306 to visit mysql, and 3306 is not allowed access from public network. How to write the iptables rules DNAT 53306 to 127.0.0.1 3306?
2
votes
2answers
76 views

Temporary redirect ports

I need a temporary redirection of some ports to another machine. I've tried: iptables -t nat -A PREROUTING -p tcp --dport 4321 -j DNAT --to-destination 192.168.121.4:80 But shorewall blocks all ...
1
vote
1answer
43 views

Configure NAT filtring behavior with iptables

I'm using this rule to configure SNAT: iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 193.49.142.107:4000 I want to specify a rule to filter out packets not destined to the internal ...
1
vote
1answer
70 views

Randomize external port when doing NAT with iptables

I want to configure a NAT behavior different from the default one implemented by iptables. In this example: iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 193.49.142.107:2000-400 The ...
1
vote
1answer
52 views

iptables - masqueraded NAT has delayed first hop in traceroute

I'm just in the process of setting up my Linux (Debian-based) router with a PPPoE connection via an ADSL/PPPoA -> PPPoE bridge. The connection works perfectly on the router itself but a traceroute ...
1
vote
1answer
42 views

Routing packets between networks with iptables

I'm trying to create a proxy of sorts using just iptables. The linux computer (my proxy) has two ports: p2p1 is connected to the Internet. em1 is connected to a local network. There are two ...
1
vote
0answers
111 views

iptables server behind NAT accessible from outside as well as inside the nat

I have 2 machines with a KVM running on each machine - so two kvms with the below networking Host 1: 192.168.10.100 (eth2) 10.10.100.1 (virbr1) KVM 1 (NAT with Host 1): 10.10.100.128 (eth0 ...
0
votes
1answer
100 views

SSH E-mail login alert if SSH port is as NAT

Can you help me with this problem please? How can I set e-mail alerting after SSH login when port 22 is NATed? I use Linux Debian 7. I have used these iptables rules: eth0 - external network, eth1 - ...
1
vote
1answer
110 views

Why aren't my iptables rules appearing in the relevant list after reboot?

I am trying to write two persistent NAT rules, which I save via iptables-save > /etc/iptables.ipv4.nat, and restore upon reboot via pre-up iptables-restore < /etc/iptables.ipv4.nat in my ...
2
votes
0answers
130 views

IPtables rule to double NAT [closed]

Let me rephrase it.. I just need an IPtable rule to do double NAT-ting.. Host A - Host B - Host C - Host D Host B should do both source NAT and destination NAT, so that my request from Host A ...
2
votes
1answer
243 views

iptables: redirect local request with NAT

I'd like to redirect local requests to port which is translated with NAT. I have following rules: iptables -t nat -A PREROUTING -p tcp --dport 9020 -j DNAT --to 10.0.3.11:80 however request coming ...
0
votes
0answers
25 views

Routing Application through different network interfaces [duplicate]

I have two interfaces on a server, let's call them eth0 and eth1. The underlying server is running CentOS 6.5 I would like to be able for some application to use eht0 while some others use eth1. ...
0
votes
1answer
233 views

iptables Port Forwarding — no service with the port

I have setup a network as in the image below: Firewall (FW) running CentOS 6 has two physical interfaces with subinterfaces: eth0:2 — 10.100.1.78/25 eth0:3 — 10.100.1.79/25 eth3 — 192.168.0.21/24 ...
1
vote
0answers
138 views

Portforwarding: router nat vs iptables [closed]

I would like to host some services on my pc and make them available from internet. (I'm aware of the security implications, it's more like a test for now). I don't have experience with iptables but I ...
1
vote
2answers
611 views

iptables: The “script” way or the “*filter, rules, COMMIT” way?

I'm trying to figure out how NAT and iptables work. While I'm in the trial-and-error phase of learning about it, I found two somewhat conflicting howtos. One howto uses a script to call iptables ...
1
vote
1answer
131 views

Managing iptables for home lan routing

I have a LAN at home. One Netgear router - 192.168.0.1 connected to the internet. One Macbook - 192.168.0.10 (connected to Netgear router) One PC with Kali Linux - 192.168.0.20 (connected to ...
0
votes
1answer
1k views

How to redirect to my squid proxy using iptables since DNAT target: only valid in nat table

I want to redirect the traffic in my lan network through squid proxy but I am having some problems with iptables rules. When I use the following rule: # iptables -I FORWARD -s ...
8
votes
1answer
2k views

Linux as router with multiple internet providers

Linux as router: I have 3 Internet providers, each with its own modem. Provider1, which is gateway address 192.168.1.1 Connected to linux router eth1/192.168.1.2 Provider2, gateway address ...
3
votes
1answer
1k views

iptables: how to allow traffic from redirected port

I have a web service running on debian 7 and listening on port 8080. I want to redirect 80 to 8080 for inbound connections and allow only port 80. Here is my iptables configuration: root@localhost:~# ...
1
vote
1answer
611 views

How does iptables MASQUERADE work on the incoming side?

I'm still reading the iptables manual page and other documents and digging around questions and their answers. This is the problem which arises. When we setup the NAT we use a POSTROUTING rule such ...
2
votes
1answer
286 views

Can iptables be used to convert a single-homed host into a NAT server?

Given: I have a machine (HostA) with only one NIC which has Internet connectivity. I have another machine (HostB) with one NIC on the same switch. HostB is not configured for Internet access yet. ...