LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2005, 06:19 AM   #1
payal_shah
LQ Newbie
 
Registered: Dec 2004
Posts: 17

Rep: Reputation: 0
Question how source address can be changed in packet


hello,

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.

can anybody suggest me any solution?
 
Old 03-29-2005, 01:55 AM   #2
3-1415
LQ Newbie
 
Registered: Jul 2004
Location: Kyiv
Distribution: Mandrake, ASP, Slackware, W2k
Posts: 19

Rep: Reputation: 0
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".
 
Old 03-29-2005, 04:39 AM   #3
payal_shah
LQ Newbie
 
Registered: Dec 2004
Posts: 17

Original Poster
Rep: Reputation: 0
no i don't want to use IPtables command

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.
 
Old 03-29-2005, 06:56 AM   #4
3-1415
LQ Newbie
 
Registered: Jul 2004
Location: Kyiv
Distribution: Mandrake, ASP, Slackware, W2k
Posts: 19

Rep: Reputation: 0
...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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changed mac address, now FC3 can't detect it lumba1 Linux - General 2 03-05-2005 05:14 AM
IP Address Is Getting Changed When System Get Suspend mehuljv Linux - Newbie 0 11-20-2004 03:15 AM
Changed modems: eth0 cant find IP address suggardaddy4242 Linux - Newbie 2 09-09-2004 11:45 AM
FC 1 Samba server - IP address changed on its own duality Fedora 4 09-01-2004 10:46 AM
problem to print source address and destination address jooboo Programming 2 11-26-2003 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration