https://wiki.archlinux.org/api.php?action=feedcontributions&user=Doctorius&feedformat=atomArchWiki - User contributions [en]2024-03-29T11:50:40ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Network_configuration_(%C4%8Ce%C5%A1tina)&diff=60838Network configuration (Čeština)2009-02-09T12:01:44Z<p>Doctorius: /* Firewall */</p>
<hr />
<div>[[Category:Network]]<br />
{{translateme}}<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|Konfigurace_sítě_(Česky)}}<br />
{{i18n_entry|English|Configuring_network}}<br />
{{i18n_entry|Español|Configurando la Red}}<br />
{{i18n_entry|Italiano|Configuring_network_(Italiano)}}<br />
{{i18n_entry|Русский|Настройка_сети_(Русский)}}<br />
{{i18n_entry|Slovensky|Statická IP a DHCP}}<br />
{{i18n_entry|Türkçe|Ağ Ayarları}}<br />
{{i18n_entry|简体中文|网络配置_(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==Shrnutí==<br />
Jednoduchý průvodce zprovozněním sítě.<br />
<br />
==Nahrání ovladače (modulu) zařízeni==<br />
Jestliže používáte hwdetect, měl by být schopen rozpoznat vaši síťovou kartu a automaticky po startu zavést odpovídající moduly. V opačném případě potřebujete vědět název modulu potřebného pro chod vaší karty. Hledejte na webu výrobce výrobce vaší karty, ve vyhledávačích nebo zkuste některou z Live distribucí a podívejte se jaký modul používa - spusťte příkaz lsmod, který zobrazí všechny aktuálně načtené moduly.<br />
<br />
Nyní předpokládejme, že znáte název potřebného modulu. Můžete ho do jádra zavést následujícím příkazem:<br />
<br />
modprobe jmenomodulu<br />
<br />
Jestliže nechcete nebo nemůžete použít auto-loader jako například hwdetect, můžete přidat názvy potřebných modulů do /etc/rc.conf, potom už nebude potřeba zavádět moduly příkazem modprobe po každém startu počítače. Např. pokud se modul jemenuje tg3:<br />
<br />
MODULES=(!usbserial tg3 snd-cmipci)<br />
<br />
Další běžné moduly jsou 8139too pro karty s čipy od RealTek nebo sis900 pro SiS karty.<br />
<br />
==Nastavení IP adresy==<br />
<br />
===DHCP===<br />
<br />
DCHP je služba, která dokáže dynamicky na požádání přidělovat klientům IP adresu (a nejen ji). Pokud dhcp používáte, upravte [[rc.conf]] následovně:<br />
<br />
eth0="dhcp"<br />
INTERFACES=(eth0)<br />
ROUTES=(!gateway)<br />
<br />
Pokud z nějákého důvodu dchpdc eth0 selhává, nainstalujte dhclienta (pacman -Sy dhclient) a použijte příkaz dhclient eth0 (samozřejmě pokud vaše síťová karta je označena jako eth0).<br />
<br />
===Statická IP===<br />
<br />
Jestliže sdílíte internetové připojeni z windowsovského boxu bez routeru, použijte na statickou IP adresu jinak můžete mít problémy se sítí.<br />
<br />
Pro konfiguraci statické IP potřebujete znát:<br />
<br />
* svou statickou IP<br />
* masku sítě<br />
* adresu broadcastu (poslední možná IP v rozsahu vaší sítě)<br />
* bránu (gateway)<br />
* IP adresy jmenných serverů<br />
* jméno vaší domény<br />
<br />
Pokud pracujete v soukromé síti, je bezpečné používat IP adresy v rozsahu 192.168.*.* , s maskou 255.255.0.0 a adresou všesměrového vysílání (broadcast) 192.168.255.255. Dokud vaše síť nemá router, na adrese brány nezáleží. Upravte [[rc.conf]] následovně, avšak nahraďte IP, masku sítě, broadcast a bránu svými vlastními hodnotami:<br />
<br />
eth0="eth0 192.168.10.1 netmask 255.255.0.0 broadcast 192.168.255.255"<br />
INTERFACES=(eth0)<br />
gateway="default gw 192.168.10.20"<br />
ROUTES=(gateway)<br />
<br />
V souboru /etc/resolv.conf potom nahraďte IP nameserveru a jméno domény vašimi vlastními. Jméno domény pro vzhledávání není vždy podmínkou:<br />
<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com<br />
<br />
Můžete zadat tolik nameserverů, kolik chcete.<br />
<br />
Pokud používáte DHCP a nechcete, aby se váš DNS server měnil při každém spuštění sítě, přidejte volbu <code>-R</code> do <code>DHCPCD_ARGS</code> v souboru /etc/conf.d/dhcpcd (používaném v /etc/rc.d/network). Tímto se zabrání, aby za každým spuštěním DHCP přepisoval váš /etc/resolv.conf:<br />
<br />
DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"<br />
<br />
==Nastavení jména počítače==<br />
Upravte [[rc.conf]] a nastavte HOSTNAME na vámi požadované jméno počítače:<br />
<br />
HOSTNAME="banana"<br />
<br />
==Nastavení lokálního překladu názvů hostitelů na IP adresy==<br />
<br />
Upravte /etc/hosts a přidejte podobný řádek se stejným HOSTNAME, jaké jste zadali v [[rc.conf]]:<br />
<br />
127.0.0.1 banana.localdomain banana<br />
<br />
Obdobně můžete přidávat i další záznamy.<br />
<br />
== Aktualizace konfigurace ==<br />
K otestování konfigurace nemusíte restartovat počítač, stačí jako root spustit <code>/etc/rc.d/network restart</code>. Nyní zkuste příkazem ping otestovat spojení na vaši bránu, DNS servery, ISP a jiné internetové servery.<br />
<br />
== Některá další nastavení ==<br />
<br />
=== Bezdrátové sítě ===<br />
<br />
Konfigurace bezdrátových sítí je probírána v [[Wireless Setup]].<br />
<br />
=== Firewall ===<br />
<br />
Abyste se cítili bezpečněji, nainstalujte a nakonfigurujte si [[Firewalls|firewall]].<br />
<br />
=== Ifplugd ===<br />
<br />
Ifplugd je služba, která automaticky konfiguruje vaše síťová rozhraní, když zapojíte kabel a poté i konfiguraci vynuluje, pokud kabel zase odpojíte. To je velmi použitelné na laptopech s integrovanou síťovou kartou, protože se bude síť konfigurovat až opravdu v okamžiku, kdy je připojen kabel.<br />
<br />
Instalace je velmi jednoduchá. Baliček se nachází v [extra]:<br />
<br />
# pacman -S ifplugd<br />
<br />
Ve výchozím stavu je služba nastavena pro spolupráci s eth0. Toto a jiné nastavení se konfiguruje v <code>/etc/ifplugd/ifplugd.conf</code>.<br />
<br />
Ifplugd spusťte příkazem:<br />
<br />
# /etc/rc.d/ifplugd start<br />
<br />
nebo jej přidejte do výčtu DAEMONS v <code>/etc/rc.conf</code>.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Swapping computers on the cable modem ===<br />
<br />
Most domestic cable ISPs (videotron for example) have the cable modem configured to recognise only one client PC, by the MAC address of its network interface. Once the cable modem has learnt the MAC address of the first PC that talks to it, it will not respond to another MAC address in any way. Thus if you swap one PC for another (or for a router), the new PC (or router) will not work with the cable modem, because the new PC (or router) has a different MAC address to the old one. To reset the cable modem so that it will recognise the new PC, you must power the cable modem off and on again. Once the cable modem has rebooted and gone fully online again (indicator lights settled down), reboot the newly connected PC so that it makes a DHCP request, or manually make it request a new DHCP lease.<br />
<br />
=== The TCP Window Scaling Issue ===<br />
<br />
TCP packets contain a "window" value in their headers indicating how much data the other host may send in return. This value is represented with only 16 bits, hence the window size is at most 64Kb. TCP packets are cached for a while (they have to be reordered), and as memory is (or used to be) limited, one host could easily run out of it.<br />
<br />
Back in 1992, as more and more memory became available, [http://www.faqs.org/rfcs/rfc1323.html RFC 1323] was written to improve the situation: Window Scaling. The "window" value, provided in all packets, will be modified by a Scale Factor defined once, at the very beginning of the connection.<br />
<br />
That 8-bit Scale Factor allows the Window to be up to 32 times higher than the initial 64Kb.<br />
<br />
It appears that some broken routers and firewalls on the Internet are rewriting the Scale Factor to 0 which causes misunderstandings between hosts.<br />
<br />
The Linux kernel 2.6.17 introduced a new calculation scheme generating higher Scale Factors, virtually making the aftermaths of the broken routers and firewalls more visible. <br />
<br />
The resulting connection is at best very slow or broken.<br />
<br />
==== How To Diagnose The Problem? ====<br />
<br />
First of all, let's make it clear: this problem is odd. In some cases, you will not be able to use TCP connections (HTTP, FTP, ...) at all and in others, you will be able to communicate with some hosts (very few).<br />
<br />
'''Warning''': <code>dmesg</code>'s output is OK, logs are clean and <code>ifconfig</code> will report normal status &mdash; and actually everything is normal.<br />
<br />
If you can't browse any website, but you can ping some rare hosts, chances are great that you're experiencing this issue: ping uses the ICMP protocol and is not affected by TCP issues.<br />
<br />
You can try to use WireShark. You might see successful UDP and ICMP communications but unsuccessful TCP communications (only to foreign hosts).<br />
<br />
==== How To Fix It? (The bad way) ====<br />
<br />
To fix it the bad way, you can change the tcp_rmem value, on which Scale Factor calculation is based. Although it should work for most hosts, it's not guaranteed, especially for very distant ones.<br />
<br />
echo "4096 87380 174760" > /proc/sys/net/ipv4/tcp_rmem<br />
<br />
Or you can try to remove one of your RAM sticks (yes, sir).<br />
<br />
==== How To Fix It? (The good way) ====<br />
<br />
Simply disable Window Scaling. Even if Window Scaling is a nice TCP feature, it may be uncomfortable especially if you can't fix the broken router. There are several ways to disable Window Scaling, and it seems that the most bulletproof (which will work with most kernels) is to add the following lines to your <code>/etc/rc.local</code>:<br />
<br />
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling<br />
<br />
==== How To Fix It? (The best way) ====<br />
<br />
This issue is caused by broken routers/firewalls, so let's change them. Some users have reported that the broken router was their very own DSL router.<br />
<br />
==== More about it? ====<br />
<br />
This section is based on the LWN article [http://lwn.net/Articles/92727/ TCP window scaling and broken routers] and a Kernel Trap article: [http://kerneltrap.org/node/6723 Window Scaling on the Internet].<br />
<br />
And more recently, some Archers have been hit by this issue:<br />
<br />
* [http://www.archlinux.org/pipermail/arch/2006-June/011250.html Odd network issue]<br />
* [http://www.archlinux.org/pipermail/arch/2006-September/011943.html Kernel 2.6.17 and TCP window scaling] &mdash; the topic which initiated this article<br />
<br />
There are also several relevant threads on the LKML.<br />
<br />
<br />
=== Realtek No Link / WOL issue ===<br />
<br />
Users with Realtek 8168 8169 8101 8111 based NICs (cards / and on board) may notice an issue where the NIC seems to be disabled on boot and has no Link light. This can usually be found on a dual boot system where Windows is also installed. It seems that using the offical realtek drivers (dated anything after May 2007) under windows is the cause. These newer drivers disable the Wake-On-Lan feature by disabling the NIC at Windows shutdown time, where it will remain disabled until the next time Windows boots. You will be able to spot if this is issue is affecting you because the Link light will remain off only until Windows boots, during Windows shutdown it will revert back to the Link light being off. Normal operation should be that the link light is always on as long as the system is on, even during POST. This issue will also affect other OS's without newer drivers (eg. Live CD's). Here's a couple of fixes for this issue.<br />
<br />
==== Method 1 - Rollback/Change Win driver ====<br />
<br />
You can rollback your Windows NIC driver to the Microsoft provided one (if available), or rollback/install to an official Realtek driver pre-dated May 2007 (maybe on the CD that came with your hardware).<br />
<br />
==== Method 2 - Enable WOL in Win driver ====<br />
<br />
Probably the best and fastest fix is to change this setting in the Windows driver. This way it should be fixed system wide and not only under Arch (eg. live CD's, other OSes). In Windows under device manager, find your Realtek Network adapter and double click it. Under the advanced tab change "wake-on-lan after shutdown" to enable.<br />
<br />
In Windows XP (example)<br />
Right click my computer<br />
--> Hardware tab<br />
--> Device Manager<br />
--> Network Adapters<br />
--> "double click" Realtek ...<br />
--> Advanced tab<br />
--> Wake-On-Lan After Shutdown<br />
--> Enable.<br />
<br />
==== Method 3 - Newer Realtek Linux driver ====<br />
<br />
Any newer driver for these Realtek cards can be found for Linux on the realtek site. (untested but believed to also solve the problem).<br />
<br />
=== DLink G604T/DLink G502T DNS issue ===<br />
Users with a DLink G604T/DLink G502T router, using DHCP and have firmware v2.00+ (typically users with AUS firmware) may have issues with certain programs not resolving the DNS. One of these programs are unfortunatley pacman. The problem is basically the router in certain situations is not sending the DNS properly to DHCP, which causes programs to try and connect to servers with an IP of 1.0.0.0 and fail with a connection timed out error<br />
<br />
==== How To Diagnose The Problem? ====<br />
The best way to diagnose the problem is to use a firefox/konqueror/links/seamonkey and to enable wget for pacman. If this is a fresh install of Arch Linux, then you may want to consider installing links through the live CD.<br />
<br />
Firstly enable wget for pacman (since it gives us info about pacman when its downloading packages)<br />
Open /etc/pacman.conf with your favourite editor and uncomment the following line (remove the # if its there)<br />
<br />
XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
<br />
While your in pacman.conf, check the default mirror that pacman uses to download packages.<br />
<br />
Now open up the default mirror in an internet browser to see if the mirror actually works. If it does work then do pacman -Syy (otherwise pick another working mirror and set it to the pacman default), if you get something similar to the following (notice the 1.0.0.0)<br />
<br />
<nowiki>ftp://mirror.pacific.net.au/linux/archlinux/extra/os/i686/extra.db.tar.gz</nowiki> <br />
<nowiki>=> `/var/lib/pacman/community.db.tar.gz.part'</nowiki> <br />
Resolving mirror.pacific.net.au... 1.0.0.0<br />
<br />
Then you most likely have this problem. The 1.0.0.0 means its unable to resolve the DNS, so we must add it to resolv.conf.<br />
<br />
==== How To Fix It? ====<br />
Basically what we need to do is to manually add the DNS to our /etc/resolv.conf file, The problem is that DHCP automatically deletes and replaces this file on boot, so we need to edit /etc/conf.d/dhcpcd and change the flags to stop DHCP doing this<br />
<br />
When you open up /etc/conf.d/dhcpcd, you should see something close to the following<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
add the -R flag to the arguments, i.e.<br />
DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"<br />
<br />
'''NOTE''': If you are using dhcpcd >= 4.0.2 the -R flag has been depreciated, please look here on ([http://wiki.archlinux.org/index.php/Configuring_network#For_DHCP_IP]) section how to use a custom resolv.conf file<br />
<br />
Save and close, now open /etc/resolv.conf. You should see a single namespace (most likely 10.1.1.1), this is the gateway to your router, which we need to connect to in order to get the DNS of your ISP. Paste the IP into your browser and login to your router. Go to the DNS section and you should see an IP in the Preferred DNS Server, copy it and paste it as a namespace ABOVE the current gateway one.<br />
<br />
I.e. a resolv.conf should look something along the lines of<br />
namespace 10.1.1.1<br />
<br />
If my Primary DNS Server is 211.29.132.12 then chance resolv.conf to<br />
namespace 211.29.132.12<br />
namespace 10.1.1.1<br />
<br />
Now restart the network daemon by doing /etc/rc.d/network restart and do pacman -Syy, if it syncs fine with the server then problem solved<br />
<br />
==== More about it? ====<br />
<br />
This is the whirlpool forum (Australian ISP community) which talks about and gives the same solution to the problem<br />
http://forums.whirlpool.net.au/forum-replies-archive.cfm/461625.html</div>Doctoriushttps://wiki.archlinux.org/index.php?title=Network_configuration_(%C4%8Ce%C5%A1tina)&diff=60837Network configuration (Čeština)2009-02-09T12:01:27Z<p>Doctorius: /* Firewall */</p>
<hr />
<div>[[Category:Network]]<br />
{{translateme}}<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|Konfigurace_sítě_(Česky)}}<br />
{{i18n_entry|English|Configuring_network}}<br />
{{i18n_entry|Español|Configurando la Red}}<br />
{{i18n_entry|Italiano|Configuring_network_(Italiano)}}<br />
{{i18n_entry|Русский|Настройка_сети_(Русский)}}<br />
{{i18n_entry|Slovensky|Statická IP a DHCP}}<br />
{{i18n_entry|Türkçe|Ağ Ayarları}}<br />
{{i18n_entry|简体中文|网络配置_(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==Shrnutí==<br />
Jednoduchý průvodce zprovozněním sítě.<br />
<br />
==Nahrání ovladače (modulu) zařízeni==<br />
Jestliže používáte hwdetect, měl by být schopen rozpoznat vaši síťovou kartu a automaticky po startu zavést odpovídající moduly. V opačném případě potřebujete vědět název modulu potřebného pro chod vaší karty. Hledejte na webu výrobce výrobce vaší karty, ve vyhledávačích nebo zkuste některou z Live distribucí a podívejte se jaký modul používa - spusťte příkaz lsmod, který zobrazí všechny aktuálně načtené moduly.<br />
<br />
Nyní předpokládejme, že znáte název potřebného modulu. Můžete ho do jádra zavést následujícím příkazem:<br />
<br />
modprobe jmenomodulu<br />
<br />
Jestliže nechcete nebo nemůžete použít auto-loader jako například hwdetect, můžete přidat názvy potřebných modulů do /etc/rc.conf, potom už nebude potřeba zavádět moduly příkazem modprobe po každém startu počítače. Např. pokud se modul jemenuje tg3:<br />
<br />
MODULES=(!usbserial tg3 snd-cmipci)<br />
<br />
Další běžné moduly jsou 8139too pro karty s čipy od RealTek nebo sis900 pro SiS karty.<br />
<br />
==Nastavení IP adresy==<br />
<br />
===DHCP===<br />
<br />
DCHP je služba, která dokáže dynamicky na požádání přidělovat klientům IP adresu (a nejen ji). Pokud dhcp používáte, upravte [[rc.conf]] následovně:<br />
<br />
eth0="dhcp"<br />
INTERFACES=(eth0)<br />
ROUTES=(!gateway)<br />
<br />
Pokud z nějákého důvodu dchpdc eth0 selhává, nainstalujte dhclienta (pacman -Sy dhclient) a použijte příkaz dhclient eth0 (samozřejmě pokud vaše síťová karta je označena jako eth0).<br />
<br />
===Statická IP===<br />
<br />
Jestliže sdílíte internetové připojeni z windowsovského boxu bez routeru, použijte na statickou IP adresu jinak můžete mít problémy se sítí.<br />
<br />
Pro konfiguraci statické IP potřebujete znát:<br />
<br />
* svou statickou IP<br />
* masku sítě<br />
* adresu broadcastu (poslední možná IP v rozsahu vaší sítě)<br />
* bránu (gateway)<br />
* IP adresy jmenných serverů<br />
* jméno vaší domény<br />
<br />
Pokud pracujete v soukromé síti, je bezpečné používat IP adresy v rozsahu 192.168.*.* , s maskou 255.255.0.0 a adresou všesměrového vysílání (broadcast) 192.168.255.255. Dokud vaše síť nemá router, na adrese brány nezáleží. Upravte [[rc.conf]] následovně, avšak nahraďte IP, masku sítě, broadcast a bránu svými vlastními hodnotami:<br />
<br />
eth0="eth0 192.168.10.1 netmask 255.255.0.0 broadcast 192.168.255.255"<br />
INTERFACES=(eth0)<br />
gateway="default gw 192.168.10.20"<br />
ROUTES=(gateway)<br />
<br />
V souboru /etc/resolv.conf potom nahraďte IP nameserveru a jméno domény vašimi vlastními. Jméno domény pro vzhledávání není vždy podmínkou:<br />
<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com<br />
<br />
Můžete zadat tolik nameserverů, kolik chcete.<br />
<br />
Pokud používáte DHCP a nechcete, aby se váš DNS server měnil při každém spuštění sítě, přidejte volbu <code>-R</code> do <code>DHCPCD_ARGS</code> v souboru /etc/conf.d/dhcpcd (používaném v /etc/rc.d/network). Tímto se zabrání, aby za každým spuštěním DHCP přepisoval váš /etc/resolv.conf:<br />
<br />
DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"<br />
<br />
==Nastavení jména počítače==<br />
Upravte [[rc.conf]] a nastavte HOSTNAME na vámi požadované jméno počítače:<br />
<br />
HOSTNAME="banana"<br />
<br />
==Nastavení lokálního překladu názvů hostitelů na IP adresy==<br />
<br />
Upravte /etc/hosts a přidejte podobný řádek se stejným HOSTNAME, jaké jste zadali v [[rc.conf]]:<br />
<br />
127.0.0.1 banana.localdomain banana<br />
<br />
Obdobně můžete přidávat i další záznamy.<br />
<br />
== Aktualizace konfigurace ==<br />
K otestování konfigurace nemusíte restartovat počítač, stačí jako root spustit <code>/etc/rc.d/network restart</code>. Nyní zkuste příkazem ping otestovat spojení na vaši bránu, DNS servery, ISP a jiné internetové servery.<br />
<br />
== Některá další nastavení ==<br />
<br />
=== Bezdrátové sítě ===<br />
<br />
Konfigurace bezdrátových sítí je probírána v [[Wireless Setup]].<br />
<br />
=== Firewall ===<br />
<br />
Abste se cítili bezpečněji, nainstalujte a nakonfigurujte si [[Firewalls|firewall]].<br />
<br />
=== Ifplugd ===<br />
<br />
Ifplugd je služba, která automaticky konfiguruje vaše síťová rozhraní, když zapojíte kabel a poté i konfiguraci vynuluje, pokud kabel zase odpojíte. To je velmi použitelné na laptopech s integrovanou síťovou kartou, protože se bude síť konfigurovat až opravdu v okamžiku, kdy je připojen kabel.<br />
<br />
Instalace je velmi jednoduchá. Baliček se nachází v [extra]:<br />
<br />
# pacman -S ifplugd<br />
<br />
Ve výchozím stavu je služba nastavena pro spolupráci s eth0. Toto a jiné nastavení se konfiguruje v <code>/etc/ifplugd/ifplugd.conf</code>.<br />
<br />
Ifplugd spusťte příkazem:<br />
<br />
# /etc/rc.d/ifplugd start<br />
<br />
nebo jej přidejte do výčtu DAEMONS v <code>/etc/rc.conf</code>.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Swapping computers on the cable modem ===<br />
<br />
Most domestic cable ISPs (videotron for example) have the cable modem configured to recognise only one client PC, by the MAC address of its network interface. Once the cable modem has learnt the MAC address of the first PC that talks to it, it will not respond to another MAC address in any way. Thus if you swap one PC for another (or for a router), the new PC (or router) will not work with the cable modem, because the new PC (or router) has a different MAC address to the old one. To reset the cable modem so that it will recognise the new PC, you must power the cable modem off and on again. Once the cable modem has rebooted and gone fully online again (indicator lights settled down), reboot the newly connected PC so that it makes a DHCP request, or manually make it request a new DHCP lease.<br />
<br />
=== The TCP Window Scaling Issue ===<br />
<br />
TCP packets contain a "window" value in their headers indicating how much data the other host may send in return. This value is represented with only 16 bits, hence the window size is at most 64Kb. TCP packets are cached for a while (they have to be reordered), and as memory is (or used to be) limited, one host could easily run out of it.<br />
<br />
Back in 1992, as more and more memory became available, [http://www.faqs.org/rfcs/rfc1323.html RFC 1323] was written to improve the situation: Window Scaling. The "window" value, provided in all packets, will be modified by a Scale Factor defined once, at the very beginning of the connection.<br />
<br />
That 8-bit Scale Factor allows the Window to be up to 32 times higher than the initial 64Kb.<br />
<br />
It appears that some broken routers and firewalls on the Internet are rewriting the Scale Factor to 0 which causes misunderstandings between hosts.<br />
<br />
The Linux kernel 2.6.17 introduced a new calculation scheme generating higher Scale Factors, virtually making the aftermaths of the broken routers and firewalls more visible. <br />
<br />
The resulting connection is at best very slow or broken.<br />
<br />
==== How To Diagnose The Problem? ====<br />
<br />
First of all, let's make it clear: this problem is odd. In some cases, you will not be able to use TCP connections (HTTP, FTP, ...) at all and in others, you will be able to communicate with some hosts (very few).<br />
<br />
'''Warning''': <code>dmesg</code>'s output is OK, logs are clean and <code>ifconfig</code> will report normal status &mdash; and actually everything is normal.<br />
<br />
If you can't browse any website, but you can ping some rare hosts, chances are great that you're experiencing this issue: ping uses the ICMP protocol and is not affected by TCP issues.<br />
<br />
You can try to use WireShark. You might see successful UDP and ICMP communications but unsuccessful TCP communications (only to foreign hosts).<br />
<br />
==== How To Fix It? (The bad way) ====<br />
<br />
To fix it the bad way, you can change the tcp_rmem value, on which Scale Factor calculation is based. Although it should work for most hosts, it's not guaranteed, especially for very distant ones.<br />
<br />
echo "4096 87380 174760" > /proc/sys/net/ipv4/tcp_rmem<br />
<br />
Or you can try to remove one of your RAM sticks (yes, sir).<br />
<br />
==== How To Fix It? (The good way) ====<br />
<br />
Simply disable Window Scaling. Even if Window Scaling is a nice TCP feature, it may be uncomfortable especially if you can't fix the broken router. There are several ways to disable Window Scaling, and it seems that the most bulletproof (which will work with most kernels) is to add the following lines to your <code>/etc/rc.local</code>:<br />
<br />
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling<br />
<br />
==== How To Fix It? (The best way) ====<br />
<br />
This issue is caused by broken routers/firewalls, so let's change them. Some users have reported that the broken router was their very own DSL router.<br />
<br />
==== More about it? ====<br />
<br />
This section is based on the LWN article [http://lwn.net/Articles/92727/ TCP window scaling and broken routers] and a Kernel Trap article: [http://kerneltrap.org/node/6723 Window Scaling on the Internet].<br />
<br />
And more recently, some Archers have been hit by this issue:<br />
<br />
* [http://www.archlinux.org/pipermail/arch/2006-June/011250.html Odd network issue]<br />
* [http://www.archlinux.org/pipermail/arch/2006-September/011943.html Kernel 2.6.17 and TCP window scaling] &mdash; the topic which initiated this article<br />
<br />
There are also several relevant threads on the LKML.<br />
<br />
<br />
=== Realtek No Link / WOL issue ===<br />
<br />
Users with Realtek 8168 8169 8101 8111 based NICs (cards / and on board) may notice an issue where the NIC seems to be disabled on boot and has no Link light. This can usually be found on a dual boot system where Windows is also installed. It seems that using the offical realtek drivers (dated anything after May 2007) under windows is the cause. These newer drivers disable the Wake-On-Lan feature by disabling the NIC at Windows shutdown time, where it will remain disabled until the next time Windows boots. You will be able to spot if this is issue is affecting you because the Link light will remain off only until Windows boots, during Windows shutdown it will revert back to the Link light being off. Normal operation should be that the link light is always on as long as the system is on, even during POST. This issue will also affect other OS's without newer drivers (eg. Live CD's). Here's a couple of fixes for this issue.<br />
<br />
==== Method 1 - Rollback/Change Win driver ====<br />
<br />
You can rollback your Windows NIC driver to the Microsoft provided one (if available), or rollback/install to an official Realtek driver pre-dated May 2007 (maybe on the CD that came with your hardware).<br />
<br />
==== Method 2 - Enable WOL in Win driver ====<br />
<br />
Probably the best and fastest fix is to change this setting in the Windows driver. This way it should be fixed system wide and not only under Arch (eg. live CD's, other OSes). In Windows under device manager, find your Realtek Network adapter and double click it. Under the advanced tab change "wake-on-lan after shutdown" to enable.<br />
<br />
In Windows XP (example)<br />
Right click my computer<br />
--> Hardware tab<br />
--> Device Manager<br />
--> Network Adapters<br />
--> "double click" Realtek ...<br />
--> Advanced tab<br />
--> Wake-On-Lan After Shutdown<br />
--> Enable.<br />
<br />
==== Method 3 - Newer Realtek Linux driver ====<br />
<br />
Any newer driver for these Realtek cards can be found for Linux on the realtek site. (untested but believed to also solve the problem).<br />
<br />
=== DLink G604T/DLink G502T DNS issue ===<br />
Users with a DLink G604T/DLink G502T router, using DHCP and have firmware v2.00+ (typically users with AUS firmware) may have issues with certain programs not resolving the DNS. One of these programs are unfortunatley pacman. The problem is basically the router in certain situations is not sending the DNS properly to DHCP, which causes programs to try and connect to servers with an IP of 1.0.0.0 and fail with a connection timed out error<br />
<br />
==== How To Diagnose The Problem? ====<br />
The best way to diagnose the problem is to use a firefox/konqueror/links/seamonkey and to enable wget for pacman. If this is a fresh install of Arch Linux, then you may want to consider installing links through the live CD.<br />
<br />
Firstly enable wget for pacman (since it gives us info about pacman when its downloading packages)<br />
Open /etc/pacman.conf with your favourite editor and uncomment the following line (remove the # if its there)<br />
<br />
XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
<br />
While your in pacman.conf, check the default mirror that pacman uses to download packages.<br />
<br />
Now open up the default mirror in an internet browser to see if the mirror actually works. If it does work then do pacman -Syy (otherwise pick another working mirror and set it to the pacman default), if you get something similar to the following (notice the 1.0.0.0)<br />
<br />
<nowiki>ftp://mirror.pacific.net.au/linux/archlinux/extra/os/i686/extra.db.tar.gz</nowiki> <br />
<nowiki>=> `/var/lib/pacman/community.db.tar.gz.part'</nowiki> <br />
Resolving mirror.pacific.net.au... 1.0.0.0<br />
<br />
Then you most likely have this problem. The 1.0.0.0 means its unable to resolve the DNS, so we must add it to resolv.conf.<br />
<br />
==== How To Fix It? ====<br />
Basically what we need to do is to manually add the DNS to our /etc/resolv.conf file, The problem is that DHCP automatically deletes and replaces this file on boot, so we need to edit /etc/conf.d/dhcpcd and change the flags to stop DHCP doing this<br />
<br />
When you open up /etc/conf.d/dhcpcd, you should see something close to the following<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
add the -R flag to the arguments, i.e.<br />
DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"<br />
<br />
'''NOTE''': If you are using dhcpcd >= 4.0.2 the -R flag has been depreciated, please look here on ([http://wiki.archlinux.org/index.php/Configuring_network#For_DHCP_IP]) section how to use a custom resolv.conf file<br />
<br />
Save and close, now open /etc/resolv.conf. You should see a single namespace (most likely 10.1.1.1), this is the gateway to your router, which we need to connect to in order to get the DNS of your ISP. Paste the IP into your browser and login to your router. Go to the DNS section and you should see an IP in the Preferred DNS Server, copy it and paste it as a namespace ABOVE the current gateway one.<br />
<br />
I.e. a resolv.conf should look something along the lines of<br />
namespace 10.1.1.1<br />
<br />
If my Primary DNS Server is 211.29.132.12 then chance resolv.conf to<br />
namespace 211.29.132.12<br />
namespace 10.1.1.1<br />
<br />
Now restart the network daemon by doing /etc/rc.d/network restart and do pacman -Syy, if it syncs fine with the server then problem solved<br />
<br />
==== More about it? ====<br />
<br />
This is the whirlpool forum (Australian ISP community) which talks about and gives the same solution to the problem<br />
http://forums.whirlpool.net.au/forum-replies-archive.cfm/461625.html</div>Doctorius