KNOW-HOW Ask Klaus! ASK KLAUS! Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: email@example.com No Connection Thank you for the comments in the September 2006 Linux Magazine regarding my IBM R50e laptop. I have now written a C++program that solves about 90% of the Sudoku problems I give it, but I am still unable to connect reliably to the Internet. I have sent and received about half a dozen e-mails using Evolution, the default under Ubuntu, but I usually get a message that says “unable to connect to pop.tiscali.co.uk” and asks again for the password, which I give it. The transmission eventually says “completed.” On receipt it says “unable to connect to pop. tiscali.co.uk” and “Error while fetching mail,” but it has received the message, after asking twice for the pop password. 54 ISSUE 72 NOVEMBER 2006 Firefox will only get the Ubuntu help from Linux on the laptop, not from the web. And Firefox times out if I enter http://www.google.co.uk. I can ping (all from the laptop) to my desktop Windows or Linux, (time1-2 ms); www.google.co.uk (time 49-52 ms); www.linux-magazine.com (time 46-48 ms). iwconfig gives: eth0 IEEE 802.11g U ESSID:"TI-AR7WD" Bit Rate=54Mb/s U Tx-Power=20dBm plus 5 more lines that look reasonable. So I guess things are nearly correct, but the system just doesn’t work! This sounds like a problem with firewall settings, or else a generic routing problem. After the Internet connection is established, please check the following settings: ifconfig eth0 This should show the general IP settings of your WLAN device (since you used iwconfig eth0 above). The card should have a valid IPV4 address, and eventually also an IPV6 address. More about that one later. route -n This should show how packets are directed over the network. There should be an entry for W W W. L I N U X - M A G A Z I N E . C O M 0.0.0.0 showing the default gateway used for traffic to and from the Internet. cat /etc/resolv.conf This file should contain the entry nameserver numerical-ip-address for resolving network names. If such an entry is missing, you can connect only to ipnumbers, not to hostnames. iptables -L This command shows your packet filter/ firewall settings. If no rules are set, there are usually three entries (INPUT, OUTPUT, FORWARD) with “policy accept.” If a lot of other rules are shown, you have some work and research ahead that’s beyond the scope of a quick answer… cat /proc/sys/net/ipv4/U ip_dynaddr If you are using on-demand connect (i.e., your computer automatically connects to the Internet when you contact an address, rather than connecting through a manual dial-up link), ip_dynaddr is supposed to take care of translating the initial (possibly unset) IP address of the first packet sent from your computer. If this file contains a 0, the first sent packet is discarded, and you get a “connection refused” message, Ask Klaus! KNOW-HOW but only for the very first attempt during this session. When this happens during a DNS query, you get a “host unknown” message (which should be close to the error message shown in the web browser). The next connection attempt will probably succeed, unless the dialon-demand setting closes the connection very quickly when no data is transferred for a while. If you type: echo 1 > U /proc/sys/net/ipv4/ip_dynaddr as root, you enable ip translation for the first packet, and you will get a valid connection or a DNS reply also for the first packet sent. This setting is not reboot-proof; you will have to add it to your boot scripts in case it is missing. There may be a GUI in your distribution for enabling ip_dynaddr on boot. In theory, there may also be some hooks for SElinux that prevent certain parts of the network configuration from working, but since you “sometimes” get a connection, this is not very likely. Windows-free and Sound Card I am installing Suse 10 on a machine that previously had Windows and has been formatted (under Windows). The installer recommends shrinking the Windows partition to a smaller size and then adding Linux. How do I convince the installer that I want a completely Windows-free clean Linux-only install? Also, for my professional audio recording needs, I am looking for a laptop with a sound card that has four channels (analog) in and out. I need the software to run this sound card, and I need tools for audio editing and mixing down to two tracks. I don’t need any of the other myriad programs you get with a Linux distro, such as the OpenOffice Suite or an e-mail/Internet application. This laptop will be a dedicated hard disc recorder only. I’m not asking you to design it for me, but can you point me in the direction of a company that can set this machine up to my requirements and sell it to me? If a Linux installer does not offer you the option to only install Linux and wipe out everything Figure 1: The AGNULA project supports professional audio and video for Linux. else, it is a bug. But you can surely circumvent this bug by manually partitioning the hard disk and deleting all partitions. Try to get hold of a root commandline in the booted Linux installation CD or DVD (usually there is one on the second installer console, Ctrl-Alt-F2), and use cfdisk /dev/hda or fdisk /dev/hda, or the same for /dev/sda, depending on your hard disk type. You can also use a Knoppix live CD for partitioning, if the installer CD does not allow you to do this. Delete all partitions, quit the partitioning program with “save changes,” and reboot (some controllers only recognize partitioning changes after reboot, really!). Now, the installer should not even give you the choice of installing Linux as a “second” operating system; it should be the only option, and no “resize” is necessary. As for your sound recording needs, you may want to have a look at the AGNULA project, http://www.agnula.org/, and specifically the Audio/Video-focused, Debian-basd DeMuDi distribution, http://demudi.agnula.org/, which should cover the software side and maybe also contain hints about which hardware is perfect for this task. I’m not a notebook hardware expert. In fact, I am not even sure if there are notebooks with professional audio quality. Even high-end notebooks tend to be equipped with noisy fans and hard disks, as well as wiring that is so tight W W W. L I N U X - M A G A Z I N E . C O M that you get line noise on analog audio input because of insufficient electric shielding. Onboard soundcards are also usually not of perfect audio quality. But I may be wrong about this. So I would just recommend asking a linux-focused notebook vendor like http://www.xtops.de/ who can tell you which hardware is fastest and most compatible, and let them build a system for you, equipped with the right kernel modules and software especially optimized for what you plan to do. Open Source business is all about customizing and support. See also http://www.linux-laptops.org/ for information about notebooks and Linux compatibility. No Upload I use openSuse 10.0. I can transfer files over the Internet using ftp, but I can’t seem to upload files to websites using http. The file transfer stalls at 162,816 bytes regardless of the size of the file or the destination. I have also had this problem when I am attaching files to yahoo.mail and google. mail, as well as when I am using Kontact. I have a dual boot machine and the files transfer just fine using MS Windows. I suspect there must be a Linux configuration file somewhere that needs to be modified. Can you help me find what I need to do to fix this? ISSUE 72 NOVEMBER 2006 55 KNOW-HOW Ask Klaus! File upload size is not an operating system limit (at least, not in the dimensions used for webforms or attachments; you may have problems if you try to attach a full DVD). An http upload most likely uses one of the following methods: • HTTP PUT – a protocol option that is not supported by too many web servers. Most admins use webDAV nowadays to directly modify files on a web server. But this is probably not what you want in this case. • HTTP POST – an option that sends a file, MIME-encoded, to a script or program running on the web server. The script on the receiving side decides what to do with this data. This is the technique webmail forms use. The file size limit for uploads is most likely a browser (client) limit or a web server limit. In PHP, which many servers use as a scripting language for handling “attachments,” there are some system variables that control upload size: ; Whether to allow U HTTP file uploads. file_uploads = On ; Maximum allowed size U for uploaded files. upload_max_filesize = 2M ; Maximum size of POST U data that PHP will accept. post_max_size = 8M You cannot upload more data than these variables allow. But this, again, is a limit on the server side. There are tricks for circumventing these server-side limits, by using compressed data formats, by using different file encodings, or by sending chunks of files and letting a server-side script reassemble them. The solution depends on your browser settings. Check for a limit set for POST operations or maximum size of transferred files in your browser. If you use Firefox on Windows, and file transfer for large files works fine, it should also succeed with Firefox on Linux, if you use the same settings. There is still the possibility nothing is wrong with your setup, but the upload script of your provider is broken, or it limits file uploads to certain browsers or client operating systems. In this case, 56 ISSUE 72 NOVEMBER 2006 Figure 2: Setting the browser identification in Konqueror. you could try to trick that broken server script by setting your browser identity (the “user-agent” id that your browser sends to the server) to a setting similar to what you use in Windows. You'll find a menu for this in Konqueror. In Firefox, try the User Agent Switcher plugin. IPV6 The Internet protocol v6 is a new network address and routing technology. It’s already implemented in Linux and most network-capable programs, but, in most cases, it is not really in use today. Yet, IPV6 configuration CAN have an impact on your general IP connectivity, even if you are quite sure you only use a plain IPV4 network. Even if your system does not have an IPV6 address (yet), some programs may still try to do IPV6 routing by default in order to reach hosts on the Internet. While this should – in theory – not be a problem (Linux and all components in the modern KDE, as well as the Gnome desktop, are IPV6-aware), it could lead to an initial timeout when the system tries to connect to the nameserver or default gateway by IPV6. In KDE, you can disable IPV6 by adding the following: KDE_NO_IPV6=TRUE to /etc/environment and restarting KDE. Rumors have it that KDE network access W W W. L I N U X - M A G A Z I N E . C O M will “tremendously speed up” with this setting, but I cannot verify this personally. Another way to disable IPV6 completely, without restarting KDE, is: ip -6 addr flush eth0 This removes IPV6 addresses (and aliases) from your network interface, in your case, the WLAN device. This may or may not improve IPV4 connectivity. A final hint: Maybe the problem is really on your provider’s side. Perhaps there are too many connections to POP3 at certain times, and the POP3 server actively disconnects clients. Other operating systems and client programs sometimes have a silent “auto-retry” feature, although most Linux mail clients only reconnect as a response to a user action. You could circumvent this dropped connection problem by choosing POP3S, the encrypted version of POP3, by checking Use SSL as a configuration option and using port 995 instead of 110 for your mail client. Since this also protects your passwords and private email from being transferred in plaintext, it is generally a good idea even without the possible connectivity improvements. ■ Send your Linux questions to firstname.lastname@example.org.