LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-12-2008, 09:31 AM   #1
Devcon
Member
 
Registered: Nov 2002
Posts: 35

Rep: Reputation: 16
[SOLVED] Gentoo, iwconfig, ndiswrapper, internet connection sharing, and an MTU


I will begin by explaing my setup as best I can.

Distribution: Gentoo kernel 2.6.27
Wireless Management: wireless-tools & wpa_supplicant (just trying it out) and ndiswrapper 1.53

Hardware:
Target Machine: Inspiron 8200 with a Marvell 8335 Wireless PCMCIA adapter
Network: Netgear MRV814 Router, Speedtouch 330 ADSL modem
ICS Host Machine: Running XP SP3 with Internet Connection Sharing enabled. Obviously, the modem is connected directly to the host computer and the router is just acting as bridge to the ICS gateway.

As a preface, ICS works perfectly fine. I can connect to the internet through my wireless router with no problems. The problem, is that I can not access any MSN services or websites I believe as a result of the MTU setting. So now we continue with some terminal output...

#lspci
Code:
03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88w8335 [Libertas] 802.11b/g Wireless (rev 03)
#ndiswrapper -l
Code:
mrv8335 : driver installed
	device (11AB:1FAA) present
#ifconfig
Code:
wlan0     Link encap:Ethernet  HWaddr 08:10:17:02:0d:39  
          inet addr:192.168.0.194  Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::a10:17ff:fe02:d39/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:264 errors:0 dropped:0 overruns:0 frame:0
          TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:252933 (247.0 KiB)  TX bytes:19569 (19.1 KiB)
          Interrupt:11 Memory:f4010000-f4020000
#iwconfig
Code:
lo        no wireless extensions.

sit0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:"NDAWHOUSE"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:09:5B:52:89:42   
          Bit Rate=11 Mb/s   Sensitivity=-200 dBm  
          RTS thr=2346 B   Fragment thr=2346 B   
          Encryption key:off
          Power Management:off
          Link Quality:50/100  Signal level:-64 dBm  Noise level:-96 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
As you can see, the MTU is currently set to 1500. The optimal MTU for PPOE ADSL connections is 1492. I believe that the host ICS computer is set to 1492; however, I will need to get back to you guys on that one. The current symptoms on the target I8200 machine are as stated, no access to msn services, and a seemingly slower connection over time. I have been googling for some time on changing the MTU with little success.

My current config files that are applicable:

/etc/conf.d/net

-I know this is not set up right at the moment. I'm learning.

Code:
 

# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

##################
#Ethernet Config
##################

config_eth0=( "null" )

##################
#Wireless Config
##################

config_wlan0=( "192.168.0.2/24" )
routes_wlan0=( "default via 192.168.0.1" )
essid_wlan0="NDAWHOUSE"
config_NDAWHOUSE=( "192.168.0.1/24 brd 192.168.0.255" )
routes_NDAWHOUSE=( "default via 192.168.0.1" )
dns_servers_NDAWHOUSE=( "192.168.0.1" )

##################
#WPA Supplicant
##################

modules=( "wpa_supplicant" )
wpa_supplicant_wlan0="-Dndiswrapper"

# It's important that we tell wpa_supplicant which driver we should
# be using as it's not very good at guessing yet
/etc/wpa_supplicant/wpa_supplicant.conf

Code:
# This is a network block that connects to any unsecured access point.
# We give it a low priority so any defined blocks are preferred.
# The below line not be changed otherwise we refuse to work
ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration
ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
network={
  ssid="NDAWHOUSE"
  scan_ssid=1
  #proto=WPA
  #pairwise=TKIP
  #key_mgmt=WPA-PSK
  #psk="pw"
  # The higher the priority the sooner we are matched
  priority=5
}
These are the only applicable config files I know of for a wireless connection. I orginally thought it may be my Marvell driver as the chipset has a bad reputation, but I have installed Ubuntu on this machine with the same exact ICS setup without problems. All msn websites and messenger worked fine. I cannot verify the MTU setting on my Ubuntu install, as Gentoo has since replaced it. Thus, I am convinced the problem lies in this configuration, as the rest of the network has not changed.

I have probably forgotten something, so let me know and I'll post more information. I wrote this in a hurry. Anyway, does anyone know how to change the MTU setting on a Gentoo install as outlined above?

Thanks in advance


Wow. I just noticed my registration date. I had no idea that I even had an account here. I just began using linux in the past year. Anyway, no matter.

Last edited by Devcon; 11-16-2008 at 02:01 PM. Reason: forgot a ]
 
Old 11-15-2008, 01:53 AM   #2
Devcon
Member
 
Registered: Nov 2002
Posts: 35

Original Poster
Rep: Reputation: 16
I'm a bit closer, but I still cannot find where to change the mtu setting. Is it even possible from within /conf.d/net? An update...
Code:
  GNU nano 2.1.5            File: /etc/conf.d/net                                

# This blank configuration will automatically use DHCP for any net.* 
# scripts in /etc/init.d.  To create a more complete configuration, 
# please review /etc/conf.d/net.example and save your configuration 
# in /etc/conf.d/net (this file :]!). 

################## 
#Ethernet Config 
################## 

config_eth0=( "null" ) 

################## 
#Wireless Config 
################## 
modules=( "iwconfig" ) 
essid_wlan0="NDAWHOUSE" 
config_wlan0=( "192.168.0.2/24 mtu 1496" ) 
routes_wlan0=( "default gw 192.168.0.1" ) 
dns_servers_wlan0=( "192.168.0.1" )
Restarting the interface:
Code:
/etc/init.d/net.wlan0 restart 

 * Caching service dependencies ...                                       [ ok ] 
 * Stopping wlan0 
 *   Bringing down wlan0 
 *     Shutting down wlan0 ...                                            [ ok ] 
 * Starting wlan0 
 *   Configuring wireless network for wlan0 
 *     wlan0 connected to ESSID "NDAWHOUSE" at 00:09:5B:52:89:42 
 *     in managed mode on channel 11 (WEP disabled) 
 *   Bringing up wlan0 
 *     192.168.0.2/24                                                     [ ok ] 
 *   Adding routes 
 *     default gw 192.168.0.1 ...                                         [ ok ] 
SIOCSIFMTU: Invalid argument                                              [ !! ]

My ifconfig output:
Code:
ifconfig (without the attempted "mtu 1496" above...) 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0 
          inet6 addr: ::1/128 Scope:Host 
          UP LOOPBACK RUNNING  MTU:16436  Metric:1 
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0 
          RX bytes:480 (480.0 B)  TX bytes:480 (480.0 B) 

wlan0     Link encap:Ethernet  HWaddr 08:10:17:02:0d:39  
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0 
          inet6 addr: fe80::a10:17ff:fe02:d39/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:568 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:598 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:283618 (276.9 KiB)  TX bytes:114224 (111.5 KiB) 
          Interrupt:11 Memory:f4010000-f4020000


It connect to my ICS network fine, but I still cannot connect to certain sites such as microsoft ones. I know I need to change the MTU. I thought the /init.d/net.wlan0 script might have an option. It refers to mtu in one section:
Code:
# Calculates the best metric for the interface 
# We use this when we add routes so we can prefer interfaces over each other 
calculate_metric() { 
   local iface="$1" metric="$2" 

   # Have we already got a metric? 
   local m=$(awk '$1=="'${iface}'" && $2=="00000000" { print $7 }' \ 
      /proc/net/route) 
   if [[ -n ${m} ]] ; then 
      echo "${m}" 
      return 0 
   fi 

   local i= dest= gw= flags= ref= u= m= mtu= metrics= 
   while read i dest gw flags ref u m mtu ; do 
      # Ignore lo 
      is_loopback "${i}" && continue 
      # We work out metrics from default routes only 
      [[ ${dest} != "00000000" || ${gw} == "00000000" ]] && continue 
      metrics="${metrics}\n${m}" 
   done < /proc/net/route 

   # Now, sort our metrics 
   metrics=$(echo -e "${metrics}" | sort -n) 

   # Now, find the lowest we can use 
   local gotbase=false 
   for m in ${metrics} ; do 
      [[ ${m} -lt ${metric} ]] && continue 
      [[ ${m} == ${metric} ]] && ((metric++)) 
      [[ ${m} -gt ${metric} ]] && break 
   done 
    
   echo "${metric}" 
}
This appears to be the area where ifconfig is spitting out that invalid argument error.

Code:
#/lib/rcscripts/net/ifconfig.sh

# bool ifconfig_pre_start(char *interface) 
# 
# Runs any pre_start stuff on our interface - just the MTU atm 
# We set MTU twice as it may be needed for DHCP - a dhcp client could 
# change it in error, so we set MTU in post start too 
ifconfig_pre_start() { 
   local iface="$1" 

   interface_exists "${iface}" || return 0 

   local ifvar=$(bash_variable "$1") mtu= 

   # MTU support 
   mtu="mtu_${ifvar}" 
   [[ -n ${!mtu} ]] && ifconfig "${iface}" mtu "${!mtu}" 

   return 0 
}

Is there a bug in this part of the script? Or, does this only work with wired interfaces or ones which do not use ndiswrapper?
 
Old 11-16-2008, 01:59 PM   #3
Devcon
Member
 
Registered: Nov 2002
Posts: 35

Original Poster
Rep: Reputation: 16
I'm going to mark this solved, although I wish I had a more detailed evaluation of the specific setting in question.

I was using kernel 2.6.27 vanilla that I had compiled myself. Downloading the new kernel 2.6.27.6 and recompiling has fixed the problem. I did not make any significant changes to the networking config portion of menuconfig.

I'll try to do a more in depth analysis of the difference between my previous kernel config and the present one.
 
Old 04-21-2009, 02:30 AM   #4
kaddy
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
I was looking for solving something earlier and stumbled across this posting, anyways, solution to the manually setting MTU issue is as follows:

Code:
mtu_iface="####"
and it will change it to whatever you set it to.
 
  


Reply

Tags
adsl, gentoo, iwconfig, mtu, ndiswrapper, settings, wireless


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet connection sharing problem!!! SandMan_Rave Linux - Networking 1 01-08-2006 11:49 AM
Internet Connection Sharing for Gentoo joopie Linux - Distributions 1 11-10-2005 05:06 PM
ndiswrapper works, iwconfig settings not saved on reboot, no internet kersten78 Linux - Wireless Networking 13 06-16-2005 08:27 PM
Internet connection sharing - WinXP + Knoppix + Gentoo Mireno Linux - Networking 1 12-17-2004 02:56 PM
Problem with Internet Connection Sharing will824 Linux - Networking 0 06-21-2003 10:53 AM


All times are GMT -5. The time now is 06:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration