Difference between revisions of "MTU"
m (Added page category) |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category: | + | {{versioninfo}} |
− | + | [[Category:Networking|*Network Setup,MTU]] | |
+ | [[Category:Troubleshooting]] | ||
− | + | Ever had problems with your MTU being set to 576 on eth0 because of your ISP or other reasons. You can fix that. | |
− | + | ||
− | + | You can check your MTU settings with the terminal command: | |
− | + | ifconfig eth# | |
+ | where eth# is the NIC you are trying to affect; in my case this was eth0 | ||
− | + | Realtime you can open a terminal and use: | |
+ | sudo ifconfig eth0 mtu #### | ||
+ | The #### is the number of the MTU you want to use; in my case 1500, so the realtime command would be: sudo ifconfig eth0 mtu 1500 | ||
− | + | Of course, if you reboot or the network gets restarted it will change to 576 again, so to make it permanent we have to edit some files, in particular the /etc/network/interfaces file. | |
+ | |||
+ | /etc/network/interfaces looks like this for a normal core on LinuxMCE: | ||
auto lo | auto lo | ||
Line 21: | Line 26: | ||
netmask 255.255.255.0 | netmask 255.255.255.0 | ||
− | So eth0 is getting | + | So eth0 is getting its IP from your ISP through DHCP and therefore also the MTU setting; eth1 is getting a static IP that's provided. |
− | + | ||
− | Now the changes you want to make to | + | Now the changes you want to make to ensure the MTU is 1500 for everything are the following.... |
+ | |||
+ | For the DHCP eth0, you need to add a line telling the NIC to set the MTU at 1500 which looks like this:- | ||
− | |||
post-up /sbin/ifconfig $IFACE mtu 1500 | post-up /sbin/ifconfig $IFACE mtu 1500 | ||
− | For the static eth1 it's easier | + | For the static eth1, it's easier to add a line telling the MTU to be 1500 (or whatever you like, you can experiment with your internal network for better package handling. I've heard up to 9000, but this is up to you) |
+ | |||
mtu 1500 | mtu 1500 | ||
− | Your interfaces file should look something like this | + | Your interfaces file should now look something like this:- |
auto lo | auto lo | ||
Line 45: | Line 51: | ||
mtu 1500 | mtu 1500 | ||
− | + | After a networking restart: | |
/etc/init.d/networking restart | /etc/init.d/networking restart | ||
− | |||
− | Hope this helps | + | look at your ifconfig again and it should have the correct MTU settings. |
+ | |||
+ | Hope this helps. Please add additional information if needed/wanted. |
Latest revision as of 12:48, 8 October 2012
Version | Status | Date Updated | Updated By |
---|---|---|---|
710 | Unknown | N/A | N/A |
810 | Unknown | N/A | N/A |
1004 | Unknown | N/A | N/A |
1204 | Unknown | N/A | N/A |
1404 | Unknown | N/A | N/A |
Usage Information |
Ever had problems with your MTU being set to 576 on eth0 because of your ISP or other reasons. You can fix that.
You can check your MTU settings with the terminal command:
ifconfig eth#
where eth# is the NIC you are trying to affect; in my case this was eth0
Realtime you can open a terminal and use:
sudo ifconfig eth0 mtu ####
The #### is the number of the MTU you want to use; in my case 1500, so the realtime command would be: sudo ifconfig eth0 mtu 1500
Of course, if you reboot or the network gets restarted it will change to 576 again, so to make it permanent we have to edit some files, in particular the /etc/network/interfaces file.
/etc/network/interfaces looks like this for a normal core on LinuxMCE:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet static address 192.168.80.1 netmask 255.255.255.0
So eth0 is getting its IP from your ISP through DHCP and therefore also the MTU setting; eth1 is getting a static IP that's provided.
Now the changes you want to make to ensure the MTU is 1500 for everything are the following....
For the DHCP eth0, you need to add a line telling the NIC to set the MTU at 1500 which looks like this:-
post-up /sbin/ifconfig $IFACE mtu 1500
For the static eth1, it's easier to add a line telling the MTU to be 1500 (or whatever you like, you can experiment with your internal network for better package handling. I've heard up to 9000, but this is up to you)
mtu 1500
Your interfaces file should now look something like this:-
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp post-up /sbin/ifconfig $IFACE mtu 1500 auto eth1 iface eth1 inet static address 192.168.80.1 netmask 255.255.255.0 mtu 1500
After a networking restart:
/etc/init.d/networking restart
look at your ifconfig again and it should have the correct MTU settings.
Hope this helps. Please add additional information if needed/wanted.