0

I'm trying to create some captures on my linux box. The problem I have is that any captures I take from the loopback interface will contain massive packets that are much larger than the MTU. This appears to because of TCP segmentation offloading. I tried following the advice in this answer and placed the following in /etc/network/interfaces:

auto lo
iface lo intet loopback
   mtu 1518
   offload-tx off
   offload-rx off
   offload-sg off
   offload-tso off
   offload-rxvlan off
   offload-txvlan off

but I am still getting massive packets that are much larger than the MTU in my captures. Is there any way to fix this?

1 Answers1

0

If you want the change immediately , try.

sudo ifconfig lo mtu 1518

Then run ifconfig lo to see the change.

BTW: You misspelled inet. Try editing the file with.

iface lo inet loopback

Also, editing that file would require the service to be restarted or a rebooted. The change doesn't make a lot of sense.

A better description of you end goal would be nice to really understand why you want smaller packets. The lo interface does not have the limitation of ethernet. You're not limited to 1500 or 9000 bytes.
MTU is at the IP layer and not at the transport layer by the way. The loopback interface is a special one. You cannot communicate normally to the internet with a loopback unless you are relaying it somehow via service. I don't see the point of the exercise unless you provide more details.

bitcollision
  • 131
  • 7
  • 1
    The point of this is to produce sample captures of traffic to/from certain services in isolation. I want these captures to be realistic samples so one of the things I wanted to ensure is that the packets were smaller than the MTU – kansas_bulldog382 Mar 18 '21 at 23:33
  • Nice, I just wanted to make sure that we were on the same page. Use the ifconfig command to reduce the mtu. The mtu is around 16000s to 65000s depending on your distribution of linux and version for the loopback interface lo. – bitcollision Mar 18 '21 at 23:58