# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
default mercury.markhob 0.0.0.0 UG 0 0 0 eth0
I now try to change the maximum segment size:
route add default mss 1384
This gives an error as follows:
SIOCADDRT: No such device
I try again this time using the host name, but this gives the same error:
route add mercury mss 1384
SIOCADDRT: No such device
What is going wrong here?
Mark.
--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Mark Hobley a écrit :
> I am trying to change the maximum segment size for the default gateway on my
> LAN. My routing table is as follows:
>
> # route
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
> default mercury.markhob 0.0.0.0 UG 0 0 0 eth0
>
> I now try to change the maximum segment size:
>
> route add default mss 1384
>
> This gives an error as follows:
> SIOCADDRT: No such device
>
> I try again this time using the host name, but this gives the same error:
>
> route add mercury mss 1384
> SIOCADDRT: No such device
>
> What is going wrong here?
When you add (i.e. create) a route, you must provide an interface or
gateway. If you want to replace/change an existing route, you can use
"ip route" instead.
> When you add (i.e. create) a route, you must provide an interface or
> gateway. If you want to replace/change an existing route, you can use
> "ip route" instead.
Right. I was mislead by the man page:
route - show / manipulate the IP routing table
----------
Route manipulates the kernel's IP routing tables.
-----------
When the add or del options are used, route modifies the routing tables.
--------
Trying again, this time using the ip command:
ip link set default mtu 1384
Cannot find device "default"
Trying again:
ip link set mercury mtu 1384
Cannot find device "mercury"
Hmmm. I list the links:
ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:11:2f:bc:df:19 brd ff:ff:ff:ff:ff:ff
Right. I only want to change the mtu for traffic that needs to traverse the
default gateway. I do not wish to reduce the mtu for all ethernet bound
traffic.
How do I achieve this?
ip link expects an interface name, not an address nor hostname (AFAIK ip
does not understand hostnames at all). Try "eth0" instead.
Side note : do not confuse MTU and MSS.
> Hmmm. I list the links:
>
> ip link show
>
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
> link/ether 00:11:2f:bc:df:19 brd ff:ff:ff:ff:ff:ff
>
> Right. I only want to change the mtu for traffic that needs to traverse the
> default gateway. I do not wish to reduce the mtu for all ethernet bound
> traffic.
Use ip route change/replace as I wrote, not ip link.
> ip link expects an interface name, not an address nor hostname (AFAIK ip
> does not understand hostnames at all). Try "eth0" instead.
That will change the whole interface though won't it? I only want to change
the MTU for traffic that needs to traverse the default gateway. The eth0
interface also carries local area network traffic. I don't want smaller
segments for local traffic.
> Side note : do not confuse MTU and MSS.
Yeah. I notice that some tools use MTU and others use MSS, oh and to add to
the confusion, others use a "packet size".
Using ping -s, my maximum "packet size" over the default gateway is 1384:
PING any-fp.wa1.b.yahoo.com (67.195.160.76) 1384(1412) bytes of data.
1392 bytes from ir1.fp.vip.ac4.yahoo.com (67.195.160.76): icmp_seq=2 ttl=45 time=305 ms
I think that means that my Maximum Transmission Unit is 1384 and my Maximum
Segment Size is 1412.
> Use ip route change/replace as I wrote, not ip link.
I am still trying:
ip route change default mtu 1384
RTNETLINK answers: No such device
ip route change mercury mtu 1384
Error: an inet prefix is expected rather than "mercury".
ip route change 10.0.0.1 mtu 1384
RTNETLINK answers: No such device
> ip route change default mtu 1384
> RTNETLINK answers: No such device
>
> ip route change mercury mtu 1384
> Error: an inet prefix is expected rather than "mercury".
>
> ip route change 10.0.0.1 mtu 1384
> RTNETLINK answers: No such device
>
Right. The syntax is as follows:
ip route change default via 10.0.0.1 mtu lock 1384
It:-)
Yes.
> Yeah. I notice that some tools use MTU and others use MSS, oh and to add to
> the confusion, others use a "packet size".
>
> Using ping -s, my maximum "packet size" over the default gateway is 1384:
>
> PING any-fp.wa1.b.yahoo.com (67.195.160.76) 1384(1412) bytes of data.
> 1392 bytes from ir1.fp.vip.ac4.yahoo.com (67.195.160.76): icmp_seq=2 ttl=45 time=305 ms
>
> I think that means that my Maximum Transmission Unit is 1384 and my Maximum
> Segment Size is 1412.
No. 1384 is the payload length ("number of data bytes", the manpage
says) and 1412 is the packet size including the payload, the ICMP header
(8 bytes) and the IP header (20 bytes). According to this, the MTU is 1412.
MSS is specific to TCP, and is generally calculated as path MTU (the
biggest packet size that can be sent on the path to the destination)
minus the IP and TCP header lengths. The minimum IPv4 and TCP header
lengths (without options) are both 20 bytes, so MSS = MTU - 40.
Note that 'mtu' specifies the maximum size of packet that can be sent to
the destination, whereas 'advmss' specifies the MSS advertised to that
destination, so that the peer won't send TCP segments with a bigger MSS.