Just yesterday i had told you how changing MTU values could sometimes solve a lot of internet browsing issues.Yesterday i had mentioned on how to do it in windows,today i will tell you how to do the same in linux.So here's how you change MTU values in linux.

I would recommend you to first try 1492 , if that doesnt work you could try these other values like 1454,1460,1452 .

Step 1 : Go to your Terminal(Applications->Accessories->Terminal) and type sudo gedit /etc/network/interfaces and enter your sudo password
Step 2 : Your text editor should now open with the interfaces file.
Step 3 : Now you need to know which interface is connected to the internet.In my case eth0 is connected to the internet via the adsl router.Incase you are not sure , you can type ifconfig in your terminal and you should see an output like this
eth0 Link encap:Ethernet HWaddr 00:0C:76:E6:71:6B
inet addr:192.168.1.10 Bcast:54.49.24.255 Mask:255.255.255.0
inet6 addr: fe80::20c:76ff:fee6:716b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3039038 errors:0 dropped:0 overruns:0 frame:0
TX packets:3235957 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2141648033 (1.9 GB) TX bytes:1683233275 (1.5 GB)
Interrupt:18 Base address:0xe800

Typically router ips are 192.168.1.1 or 192.168.0.1 so note the inet addr value in your ifconfig output.if it contains an ip of the type 192.168.1.x or 192.168.0.x then that interface is the one which is most likely connected to the internet.In my case if you notice eth0 has the ip 192.168.1.10 .Hence eth0 is the interface that i have to modify

Step 4 : Now in the interfaces file you should find a line like this

iface eth0 inet dhcp or iface eth0 inet static

if in your case eth1 is the interface connected to the internet then look for

iface eth1 inet dhcp or iface eth1 inet static

I hope you got what im saying!!!
Step 5 : Now under this line , add the following line
mtu 1492

So for example it would look like

iface eth0 inet dhcp
mtu 1492

NOTE:As said earlier if 1492 doesnt work then try 1454,1460,1452 after that
Step 6 : Save the interfaces file and close it.Better reboot your pc and you should have things working!!!

5 comments

Unknown said... @ September 13, 2008 at 6:42 PM

Alternatively, you may use:

ifconfig [dev] mtu [1492 or whatever]

Where [dev] is eth[0-9].

example:
in a console/terminal window type in
su - [hit enter]
[enter root password]
ifconfig eth0 mtu 1492
exit

You can ALSO add the ifconfig line to /etc/init.d/boot.local or on some flavors of linux to /etc/rc.local using your favorite text editor.

Peace.

Unknown said... @ July 22, 2009 at 10:58 AM

Whoa! You are the MAN! I could not access Hotmail, facebook, or linedin on Ubuntu 9.04, and it was driving me nuts!!! At first, I thought it was an evil monopoly trying to block me, but I tried an Ubuntu 8.04 live cd and got on these sites just fine. So, I was like what the F*** is going on. Then, I came across your post and tried it and viola- I can access sites on my Linux box again. Thank you so very much.

Prash Babu said... @ July 22, 2009 at 10:34 PM

Glad it helped!!

Nimesh said... @ November 13, 2009 at 10:49 AM

but thasts about Linux. how to do it for Windows..
A LinkedIn mail suggested me how to do it, but my net stopped working after that. i had to restart my system..
-
Nimesh

Prash Babu said... @ November 14, 2009 at 12:30 AM

http://www.prash-babu.com/2008/06/how-to-change-mtu-values-in-windows.html

Post a Comment