Thank you Gert, no wonder my code was working when I used the tab interface. Now that I'm using tun interface, my code worked by eliminating the ethernet header processing. Thanks again!
- Abdullah On Dec 20, 2013, at 1:19 AM, Gert Doering <g...@greenie.muc.de> wrote: > Hi, > > On Thu, Dec 19, 2013 at 06:56:19PM -0700, Abdullah Alshalan wrote: >> I tried to print out the ethernet and IP headers of the packets in the >> incoming_tun buffer. The methods that does the printing is mentioned below. >> I run the modified openvpn code and established a VPN tunnel.. I established >> an FTP connection between machine A (running openvpn client and ftp client ) >> tun ip is 10.0.8.2 and machine B running FTP server whose IP is 10.0.0.2. > > If it's a *tun* interface, it won't have ethernet headers. That's just > plain IP(v6), no ethernet. > >> The printed packet info showed incorrect mac addresses, incorrect SRC and >> DEST IPs.The only thing that was printed correctly was the IP protocol. it's >> always showing 20 or 21. > > IP protocol should be "6" for TCP. > > 20/21 would be the tcp port numbers for FTP. > > gert > -- > USENET is *not* the non-clickable part of WWW! > //www.muc.de/~gert/ > Gert Doering - Munich, Germany g...@greenie.muc.de > fax: +49-89-35655025 g...@net.informatik.tu-muenchen.de