Difference between revisions of "MTU"
m (Added page category) |
|||
Line 1: | Line 1: | ||
− | [[Category: | + | [[Category: Networking]] |
+ | [[Category: Troubleshooting]] | ||
+ | |||
Ever had problems with your MTU being set to 576 on eth0 because of you ISP or other reasons. You can fix that. | Ever had problems with your MTU being set to 576 on eth0 because of you ISP or other reasons. You can fix that. | ||
− | you can check your mtu settings with the terminal command: ifconfig eth# | + | 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 | 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 #### | + | |
+ | 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 | 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 | ||
+ | |||
Ofcourse 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. | Ofcourse 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 23: | Line 29: | ||
So eth0 is getting it's ip from your isp through dhcp and therefor also the mtu setting | So eth0 is getting it's ip from your isp through dhcp and therefor also the mtu setting | ||
Eth1 is getting a static ip that's provided. | Eth1 is getting a static ip that's provided. | ||
+ | |||
Now the changes you want to make to make sure the mtu is 1500 for everything are the following.... | Now the changes you want to make to make sure 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 | 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 and you can 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) | For the static eth1 it's easier and you can 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 47: | Line 57: | ||
after a networking restart: | after a networking restart: | ||
/etc/init.d/networking restart | /etc/init.d/networking restart | ||
+ | |||
look at your ifconfig again and it should have the correct mtu settings | look at your ifconfig again and it should have the correct mtu settings | ||
+ | |||
Hope this helps, please add aditional information if needed/wanted. | Hope this helps, please add aditional information if needed/wanted. |
Revision as of 15:30, 20 October 2009
Ever had problems with your MTU being set to 576 on eth0 because of you 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
Ofcourse 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 it's ip from your isp through dhcp and therefor also the mtu setting Eth1 is getting a static ip that's provided.
Now the changes you want to make to make sure 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 and you can 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 aditional information if needed/wanted.