Results 1 to 3 of 3
Hi,
Here is the situation:
Machine_A (eth0: 192.168.0.253)
Machine_B (eth0: 192.168.0.100, eth1: 10.0.0.100)
Machine_C (eth1: 10.0.0.3)
I want to remotely debug a process on Machine_C from Machine_A. However, since they ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-20-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 3
iptables port forwarding + remote debugging
Hi,
Here is the situation:
Machine_A (eth0: 192.168.0.253)
Machine_B (eth0: 192.168.0.100, eth1: 10.0.0.100)
Machine_C (eth1: 10.0.0.3)
I want to remotely debug a process on Machine_C from Machine_A. However, since they are in two different networks, I am trying to setup port forwarding using iptables (192.168.0.100:50003::10.0.0.3:2000), i.e. all requests on port 50003 on Machine_B (192.168.0.100) would be forwarded to port 2000 on Machine_C (10.0.0.3).
Assuming port forwarding works fine, I will start gdbserver on Machine_C to listen on port 2000, while Machine_A will use 'target remote 192.168.0.100:50003'.
Does this sound right?
If so, I am not able to get it working. Here is the iptables script I have run on 192.168.0.100:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 50003 -j DNAT --to 10.0.0.3:2000
iptables -t nat -A POSTROUTING -i eth0 -s 10.0.0.3 -p tcp --sport 2000 -j MASQUERADE --to 50003
I would appreciate any help/comments in this regard.
Thanks in advance,
Best regards,
R. Iyer
- 03-22-2009 #2
- 03-25-2009 #3Just Joined!
- Join Date
- Mar 2009
- Posts
- 3
Hi Robert,
Thanks for your reply.
I tried to change the option from -i to -o as you suggested. However, it does not seem to work.
Also, I want to know if anyone has tried doing remote debugged through ports mapped by iptables?
Best regards,
R. Iyer


Reply With Quote

