PDA

View Full Version : sendto raw packet on ppp


uarcho
04-15-2003, 01:32 PM
Hello!
I'm writing a NAT router in c under linux(knoppix).In order to do this I sniff packets from ETH0 and sending to PPP0 with source address changed (a sort of ip masquerading). To send on PPP0 I use the "struct sockaddr_ll" defined in "if_packet.h" and the sendto socket function. This function return the correct number of bytes send, but nothing is sended on the link. Infact if I run "ETHEREAL" on the same machine from which I try to send the packet, it correctly sniffs the packet on PPP0;but on the otherside of the null-modem link nothing arrive.So I look at "/proc/net/dev" I found that the packet are dropped during transmission...
Can someone tell me why?

Thanks in advance

P.s.=the machines correctly ping each other

RobSeace
04-15-2003, 01:43 PM
Just a guess, but have you checked the MTU? It may be the packet
you're trying to send is larger than the MTU of the PPP link, so it gets
dropped...

Also, you do know that Linux has built-in NAT/IP-masq functionality,
so you don't really need to write your own, right?? If so, and this is
just a fun project, then nevermind... ;-)

uarcho
04-15-2003, 01:54 PM
No the bytes send are much less than MTU (1500), ah and I know about iptables and ipchains but it's a university project.