iptables forwarding not working?


 
Thread Tools Search this Thread
Special Forums Cybersecurity iptables forwarding not working?
# 1  
Old 09-10-2010
iptables forwarding not working?

Hello, i am trying to setup a iptables rule to forward port 49 traffic from a specific ip a.a.a.a to port 50, but it does not seem to work, can someone take a look at my rule and let me know why it is not working? thanks

Code:
iptables -t nat -A PREROUTING -s a.a.a.a/32 -p tcp --dport 49 -j REDIRECT --to-port 50


Last edited by Scott; 09-25-2010 at 04:43 AM..
# 2  
Old 09-25-2010
With your subnet mask of /32, its possible your source address is not matching correctly. With a mask of /32 that allows 1 IP address. Try "-s a.a.a.a/24", this means for the last octet can be in the range of 1-254.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

iptables port forwarding

Hello All, I would like to ask you very kindly with /etc/sysconfig/iptables file I have to setup port forwarding on RHEL6 router. Users from public network must be able to ssh to servers in private network behind RHEL6 router. Problem is that servers in private network must be isolated. My... (2 Replies)
Discussion started by: oidipus
2 Replies

2. IP Networking

Port Forwarding not working

Hello Gurus, I have configured port forwarding at router. But after configuration I am not able to connect the computer from outside/Over internet/Remote desktp from other computer. Could you please advice? Thanks- Pokhraj (2 Replies)
Discussion started by: pokhraj_d
2 Replies

3. UNIX for Dummies Questions & Answers

Iptables, port forwarding, 64k connection limit?

I am having an issue with iptables. My server is a RHEL6 64bit system. In my application I have a large number of connected clients ~100k to a particular service. The application works fine when iptables is off, 100k clients are able to connect. However, when I turn iptables on and add a... (1 Reply)
Discussion started by: jtipp3tt
1 Replies

4. IP Networking

iptables port forwarding does not work while I have 2 routes

Hi, On my linux server I have 2 routes: Code: nexthop via 123.201.254.5 dev eth0 weight 38 nexthop via 111.93.155.149 dev eth2 weight 36 I have a iptable rule like : iptables -t nat -A PREROUTING -p tcp -i eth0 -d... (5 Replies)
Discussion started by: ashokvpp
5 Replies

5. Shell Programming and Scripting

Email forwarding to shell script is not working

Trying to redirect email received to shell script using the following command in the .forward file \vudum001, "| /home/vudum001/kk $1" /home/vudum001 : Home directory kk script file in home directory kk file contents echo $1 >>file1 gave 755 access to .forward as well as script... (1 Reply)
Discussion started by: mvudugula
1 Replies

6. Web Development

Apache to Tomcat forwarding not working properly

Hi, I am facing some problem with Apache to Tomcat forwarding. I have Tomcat (6.0.18) behind Apache (2.2). I want to use ‘https' for receiving request from the client. This request, when forwarded by Apache to Tomcat, will use ‘http'. My application's name is ‘abc', which is deployed in... (1 Reply)
Discussion started by: Technext
1 Replies

7. UNIX for Advanced & Expert Users

Forwarding internal internet packets to internal webserver using iptables

Hi, I need to redirect internal internet requests to a auth client site siting on the gateway. Currently users that are authenticated to access the internet have there mac address listed in the FORWARD chain. All other users need to be redirected to a internal site for authentication. Can... (1 Reply)
Discussion started by: mshindo
1 Replies

8. Cybersecurity

ssh X-forwarding and remote forwarding behind proxy

Hi, from my workplace we use a proxy to connect to the outside world, including external ssh servers. The problem is that the server is seeing the connection coming from the proxy and knows nothing about the client behind it. The ssh connection itself works fine, but x-forwarding does not work as... (1 Reply)
Discussion started by: vampirodolce
1 Replies

9. UNIX for Dummies Questions & Answers

X11 forwarding not working

Hi, I am using Putty, enabled SSH X11 forwarding and entered the X11 display location as "localhost:0". However I encountered the following error: ------------------------------------ # xclock & 2941 # X connection to localhost:10.0 broken (explicit kill or server shutdown). + Exit 1... (4 Replies)
Discussion started by: panggou
4 Replies

10. UNIX for Dummies Questions & Answers

iptables: forwarding a port

I've been googling for a while now, trying to forward port 3000 to port 80.... In the past I used to DLink router to forward port 3000 to 80. I recently finished (well, is it ever done anyhow?) setting up my linux box and got it acting as a router. I want to continue to run Apache on port 80... (1 Reply)
Discussion started by: meeps
1 Replies
Login or Register to Ask a Question