Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i want to change a source address in packet and then send to destination address.
i am using a PCAP library so i come to know that some packet is coming from suppose 192.160.100.105 address to destination address 200.200.200.201. now my address is 192.160.100.100 and i want to change source address of 192.160.100.105 to 192.168.100.100.
try to use NAT from iptables packet.
may be start here: http://qtables.radom.org/samples.php
Also with iptables you may change any field in TCP/IP header, including IP's source address. Read Oscar Andersson's "IPTables Tutorial".
i don't want to use IPTABLES commands
actually i want to implement NAT myself as project work.
i want to capture the packet but not to sniff it.
how to change source address of the packet. at IP layer.
pls send me the solution , its really urgent.
...there used to be a good example in William Stevens's "UNIX Network Programming. Networking APIs", chapter 26. Exactly what You need.
The sources to this book you may find here: http://www.kegel.com/unpv1/
Good luck
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.