Implementing NAT function with java
1 posts in topic
Flat View  Flat View

Posted By:   Kamal_Kassab
Posted On:   Saturday, October 19, 2002 10:49 PM

I am trying to implement the NAT function with java (i.e., change the source IP address of outgoing packets,
and the destination IP address for incoming packets). After spending some time on this, I have
come to the conclusion that I need to at least be able to send and receive packets at the ethernet level (layer 2).

1- Is my conclusion right? If so is there a library similar to java.net for ethernet trans/receive?

2- If not, how should I go about implementing the NAT function?

Thank you

Please use html tags to format code blocks.

Re: Implementing NAT function with java

Posted By:   Bryan_Boyer  
Posted On:   Monday, November 18, 2002 02:28 PM

We where looking at something like this at one time. After many false starts we have came to the conclusion that we needed to write a kernal module (we where using Linux) to work at the ethernet level. This is not a trivial exercise; you have to deal with ARP, DNS as well as standard IP packets. And in the DNS packet you need to modify the packet Payload. If all you want to do is NAT, then I believe you can find a Linux router that will do it for you, coyote is one such implementation.
About | Sitemap | Contact