# mtu issue

## plut0

For about 10+ years I've been using Time Warner Road Runner.  I don't know what changed but recently the default mtu 1500 is no longer stable over the Internet.  Many websites time out or hang because the mtu is too high.  I am using a gentoo machine as my router.  A workaround is to change the mtu on the client side to 1492.  I would like to fix the problem on the router instead.  I've had this rule in my iptables, the counter goes up showing that its using the rule but it doesn't fix the problem:

```
iptables -A FORWARD -o eth0 -p tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1453: -j TCPMSS --clamp-mss-to-pmtu

iptables -A FORWARD -i eth0 -p tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1453: -j TCPMSS --clamp-mss-to-pmtu
```

How can I fix this issue on the router?

----------

## gringo

any chance you use dhcpcd to get your ips ?

i had the same problem with the latest versions of dhcpcd : mtu was changed for some reason i still don´t know, manullay setting it solved it of course.

There is a mtu setting in the dhcpcd configuration file, either setting that or setting mtu manually with ifconfig did help here.

cheers

----------

## plut0

The mtu is 1500 which is what it has always been.  However, that no longer works 100% with my ISP.  I guess the best way to fix this is just by changing the mtu to 1492 on my router.

I would like to know why 1500 doesn't work anymore but I don't think I'll get the answer to that question.

----------

## malern

Try adding 

```
mtu_eth0="1492"
```

to /etc/conf/net. Replace "eth0" with whatever your internet facing interface is.

----------

## eagle_cz

Its loooon time, since i have been playing with this, but its PPP connections related issue.

Recomanded MTU for PPP is 1492.

Well.. you should test your connection with ping and various MTU. If your MTU is too high, you should receive some ICMP messages about "packet fragmentation". Keep lowering your MTU, until you will receive normal ICMP reply.

Size of MTU is one of ping command parameters.

----------

## UberLord

FWIW, I have the same issue, because I use a PPPoA->PPPoE bridge so I can terminate native IPv6 over PPP on my server. There is no way around it, and I have to clamp to 1452 to get things to work correctly.

----------

## plut0

Thanks for the info guys.  How would I set the mtu permanently if eth0 is using dhcpcd?  The "mtu_eth0" doesn't seem to work with dhcpcd.

----------

## UberLord

Later dhcpcd versions use the MTU set by the DHCP server.

You can override this with a static setting like so in /etc/dhcpcd.conf

interface eth0

static interface_mtu=1492

----------

## plut0

I'm guessing that doesn't apply to the version I'm using?

emerge dhcpcd -vp

```
These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] net-misc/dhcpcd-4.0.15  USE="-compat -zeroconf" 52 kB
```

When I start dhcpcd I get this error:

dhcpcd: unknown option -- static

----------

## mrness

 *plut0 wrote:*   

> For about 10+ years I've been using Time Warner Road Runner.  I don't know what changed but recently the default mtu 1500 is no longer stable over the Internet.  Many websites time out or hang because the mtu is too high.  I am using a gentoo machine as my router.  A workaround is to change the mtu on the client side to 1492.  I would like to fix the problem on the router instead.  I've had this rule in my iptables, the counter goes up showing that its using the rule but it doesn't fix the problem:
> 
> ```
> iptables -A FORWARD -o eth0 -p tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1453: -j TCPMSS --clamp-mss-to-pmtu
> 
> ...

 

You have to do the following changes on your router:

 1) Add the iptables rule 

```
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
```

 2) Set MTU 1492 on your router interface towards WAN

Alternatively you can reduce MSS w/o changing the interface MTU by adding iptables rule

```
iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1452
```

----------

