Changing source IP address of TCP/IP Packets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello to all,

I want to change source IP address and destination IP address of packets
which which i am transmitting and receiving. I have tried this using filter
Hook Driver on IP Filter driver (IPFltdrv.sys) of Windows.

Can i change IP addresss to some virtual IP (which does not exist on my
network). I have used route add command and made my computer as a gateway for
all these virtual IPs'. When i change this virtual IP in Filter Hook driver
set on my machine, after changing the destination IP address to physical IP
address of my machine i am forwarding packet to IP Filter driver (PF_FORWARD
and PF _PASS), but after that no reply is coming from tcpip.sys.

I am able to change the port no. in TCP packet but when changing the IP
address receiving machine is not sending reply of packet.

Thanks in advance

Bye,
Vibhor Mahajan
 
I want to change source IP address and destination IP address of packets
which which i am transmitting and receiving.
..........................
I am able to change the port no. in TCP packet but when changing the IP
address receiving machine is not sending reply of packet.

Of course it won't. How is it supposed to send the reply back to a source IP
that does not exist because you altered it in the packet?
 
The exact scenario is:

1 .Server connecting to virtaul IP (172.16.0.1) with its physical source
address(10.0.0.12) on port 8888.
2. On server there is a route add entry to forward such virtaul IP
(172.16.0.1) to a machine 10.0.0.25.
3. packets for virtual IP are received on machine 10.0.0.25. This is checked
with etheral software.
4. in IpFilre driver i am changing the destination IP from (172.16.0.1) to
10.0.0.25.
5. so packet is for destination with physical IP.
6. Server machine is listening on specfied port 8888
7. But afater changing virtual IP to phyisal IP in machine 10.0.0.25 in
Filter Hook Driver, and forwarding this acket to IPFIlter driver for default
processing packet is lost in TCPIP stack.
8. No since packet is for destination machine TCPIP layer TCP protocol
should generate reply to that packet. but i am not getting reply from TCP
layer.

Thanks
Vibhor Mahajan
 
hi Phillip,

I am sorry last message i posted was not clearly stating my query and was
quite ambiogious.

This is the exact scenerio:

I want to change source IP address and destination IP address of packets
which which i am transmitting and receiving. I have tried this using filter
Hook Driver on IP Filter driver (IPFltdrv.sys) of Windows.

The exact scenario is:

1 .Client connecting to virtual IP (172.16.0.1) with its physical source
address(10.0.0.12) on port 8888.
2. On client there is a route add entry to forward such virtual IP (
172.16.0.1) address packets to a machine 10.0.0.25 (server).
3. packets for virtual IP are received on machine 10.0.0.25. This is checked
with etheral software.
4. in Filter Hooko driver on IPFLTDRV.sys i am changing the destination IP
from (172.16.0.1) to 10.0.0.25.
5. so after changing packet is for destination with physical IP 10.0.0.25.
6. Server machine is listening on specfied port 8888
7. But afater changing virtual IP to phyisal IP in machine 10.0.0.25 in
Filter Hook Driver, and forwarding this acket to IPFIlter driver for default
processing, packet is lost in TCPIP stack.

What is the best driver to do the above task.
1 Filter Hook Driver
2 NDIS protocol driver
3 NDIS Intermediate Driver.

Thanks
Vibhor Mahajan


Phillip Windell said:
I don't know what to tell you there.


--
Phillip Windell [MCP, MVP, CCNA]
www.wandtv.com



Vibhor Mahajan said:
The exact scenario is:

1 .Server connecting to virtaul IP (172.16.0.1) with its physical source
address(10.0.0.12) on port 8888.
2. On server there is a route add entry to forward such virtaul IP
(172.16.0.1) to a machine 10.0.0.25.
3. packets for virtual IP are received on machine 10.0.0.25. This is checked
with etheral software.
4. in IpFilre driver i am changing the destination IP from (172.16.0.1) to
10.0.0.25.
5. so packet is for destination with physical IP.
6. Server machine is listening on specfied port 8888
7. But afater changing virtual IP to phyisal IP in machine 10.0.0.25 in
Filter Hook Driver, and forwarding this acket to IPFIlter driver for default
processing packet is lost in TCPIP stack.
8. No since packet is for destination machine TCPIP layer TCP protocol
should generate reply to that packet. but i am not getting reply from TCP
layer.

Thanks
Vibhor Mahajan
 
Back
Top