Disabling TCP checksum offloading on Mac OSX (needed for pcap-based programs)
While playing with tcpdump and bro I noticed that all outgoing packets have garbled TCP checksums. The diagnosis was simple: TCP checksum offloading. The real question was how to disable it
After a big of googling I found the magic command:
sysctl -w net.link.ether.inet.apple_hwcksum_tx=0
sysctl -w net.link.ether.inet.apple_hwcksum_rx=0
There’s one catch though. Disabling TCP checksum offloading effectively corrupts TCP checksum on the lo interface and, as you can well imagine, things stop working. In particular, you will not be able to start any graphical applications anymore… So it looks either playing with the network or working… There’s no free lunch.
At the end the solution with bro turned out to be simpler – you can tell it to ignore checksums with -C flag as everything works as on my linux box.
BTW: my favourite bro command
bro -C -i en0 conn http-request http-reply [http-headers] [http-body]
writes connection summaries to conn.log and http-related stuff to http.log. Depending on the amount of details you need, you can have: only requests, requests plus information about the results (HTTP return code and the size of the result). Additional modules record the browser headers or even the entire page loaded.
September 5th, 2007 at 6:08 am
Hi, I want to disable checksum offload running any script on windows 2000. The issue is my packets checksum is failing when i m sending packets from emulator using fake MAC. So i need to disable checksum offload automatically when I am sending packets from emulator.
September 24th, 2007 at 7:37 pm
Well, what about if I want to disable checksum in my wifi card that is on slot 3?
Any Ideas?
Thanx
November 30th, 2007 at 1:00 am
Why do you want to disable the offload checksum? It will increase the CPU load if you have TCP traffic.
January 22nd, 2008 at 10:26 am
wow so i did this command and my computer is f’ed up. how do i reverse it? my thread:
http://forums.macrumors.com/showthread.php?t=419114