Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wondershaper/GCE - standard MTU causes fragmentation, some Google sites fail. #39

Closed
mwoolweaver opened this issue Dec 5, 2019 · 4 comments

Comments

@mwoolweaver
Copy link

mwoolweaver commented Dec 5, 2019

MTU not being set properly will cause connectivity issues. It seems wondershaper sets a default value of 1500 which probably ok in most cases but google use a 1460 MTU for the GCE network so this will cause intermittent connectivity issues.

Wondershaper should mimic the GCE MTU of 1460 and everything seems to work as it should.

More info can be found in the links below

https://www.reddit.com/r/WireGuard/comments/aru07q/wireguard_slow/

StreisandEffect/streisand#1089

StreisandEffect/streisand#1552

@magnific0
Copy link
Owner

@mwoolweaver I'm open to fixing this issue. However, my time and knowledge are limited. Where does wondershaper actually set this MTU to 1500? Can you provide a line?

https://github.com/magnific0/wondershaper/blob/master/wondershaper

Or is that a default value for tc?

@mwoolweaver
Copy link
Author

mwoolweaver commented Apr 1, 2020

It’s very possible that this is a default value. I haven’t used wondershaper in a couple months. I was using it to limit upload/download speeds of a python script I was using to tweet pihole stats amongst other things.

https://github.com/mwoolweaver/tweetStats

I’m not sure of the best way to address the issue for more users. My idea would be to check the interface that is be I used for internet access but I’m sure how to go about determining the which interface that is? Or would it better to use ifconfig to check for the lowest MTU value and set a value lower than that?

@magnific0
Copy link
Owner

magnific0 commented Apr 2, 2020

Thanks, that's what I understand too. In that case it's probably smarter to do it for the entire interface separate from wondershaper. The instructions for this are:

View current MTU

ifconfig

Outputs something like:

eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
         inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::20f:eaff:fe91:407/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:141567 errors:0 dropped:0 overruns:0 frame:0
         TX packets:141306 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:101087512 (96.4 MiB)  TX bytes:32695783 (31.1 MiB)
         Interrupt:18 Base address:0xc000

Or use ip command:

ip link list

Which looks like:

1: lo:  mtu 16436 qdisc noqueue
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000
   link/ether 00:0f:ea:91:04:07 brd ff:ff:ff:ff:ff:ff
3: sit0:  mtu 1480 qdisc noop
   link/sit 0.0.0.0 brd 0.0.0.0

In this examples MTU set to 1500 for eth0. To change this to 1460 use either:

ifconfig eth0 mtu 1460

or

ip link set dev eth0 mtu 1460

Example taken from https://www.cyberciti.biz/faq/how-can-i-setup-the-mtu-for-my-network-interface/ accessed April 4, 2020.

@mwoolweaver
Copy link
Author

But if I remember correctly wondershaper creates a network interface for itself to control the flow of traffic and that’s the interface that doesn’t have the MTU set. In my case the MTU for eth0 is 1460 and I had to adjust the interface for wondershaper to match that or I had this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants