I want to capture ip packages on one server, and then forward the packages to another server by libnet, who has some examples ? thanks in advance.
Check out these tutorials:
Libnet 1.1 tutorial for beginners
If you have code fragments that are not working, please include.
Edit
The 2nd link no longer works. Below is a different link that might help. In general, links should not be listed since they expire or become obsolete. Searching for 'libnet tutorial for beginners' or 'pcap tutorial for beginners' would be a good start.