If it works, then you may only wish to personalize your settings from the options below.

If it works, then you may only wish to personalize your settings from the options below.

+

+

If the previous command complains about unknown hosts, it means that your machine was unable to resolve this domain name. It might be related to your service provider or your router/gateway. You can try pinging a static IP to prove that your machine has access to the Internet.

+

{{hc |

+

$ ping -c 3 8.8.8.8 |

+

<nowiki>PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

+

64 bytes from 8.8.8.8: icmp_req=1 ttl=53 time=52.9 ms

+

64 bytes from 8.8.8.8: icmp_req=2 ttl=53 time=72.5 ms

+

64 bytes from 8.8.8.8: icmp_req=3 ttl=53 time=70.6 ms

+

+

--- 8.8.8.8 ping statistics ---

+

3 packets transmitted, 3 received, 0% packet loss, time 2002ms

+

rtt min/avg/max/mdev = 52.975/65.375/72.543/8.803 ms</nowiki>}}

+

+

{{Tip|8.8.8.8 is a static address that is easy to remember. It is the address of Google's main DNS server, therefore it can be considered reliable, and is generally not blocked by content filtering systems and proxies.}}

+

+

If you are able to ping this address,

==Set the host name==

==Set the host name==

Revision as of 22:05, 3 February 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Tip: The -c 3 options instruct ping to do so three times. See man ping for more information.

If it works, then you may only wish to personalize your settings from the options below.

If the previous command complains about unknown hosts, it means that your machine was unable to resolve this domain name. It might be related to your service provider or your router/gateway. You can try pinging a static IP to prove that your machine has access to the Internet.

Tip: 8.8.8.8 is a static address that is easy to remember. It is the address of Google's main DNS server, therefore it can be considered reliable, and is generally not blocked by content filtering systems and proxies.

If you are able to ping this address,

Set the host name

A host name is a unique name created to identify a machine on a network. With Arch Linux, a machine's host name is set in /etc/rc.conf or until a restart using the hostname command.
Host names are restricted to alphanumeric characters. The dash (-) can be used, but a host name cannot start or end with it. Length is restricted to 63 characters.

Edit /etc/rc.conf and set the HOSTNAME variable (archlinux in this example):

HOSTNAME="archlinux"

After setting a host name, it is also important to include the same host name in /etc/hosts. This will help processes that refer to the computer by its host name to find its IP address, as well as programs that rely on the gethostname() system call to determine the system's host name.

Edit /etc/hosts and add the same HOSTNAME you entered in /etc/rc.conf:

Note: The fully qualified domain name (FQDN) should be the first item following the IP address. All of the names on the right side are just aliases for the left-most host/domain name. You can check if this has been properly configured by running hostname --fqdn.

To set the host name temporarily (until the next reboot) use the hostname command as root:

Load the device module

Udev should detect your network interface card (NIC) module and load it automatically at startup. If it does, skip this section. Otherwise, you will need to know which module is needed for your particular model:

# hwdetect --show-net

Since hwdetect isn't installed by default and most NICs work out of the box on linux, you're better of using lspci

# lspci | grep -i Ethernet

Then google for the right module/driver for the chip

Once you know which module to use, you can load it with:

# modprobe <modulename>

If udev is not detecting and loading the proper module automatically during bootup, you can add it into the MODULES array in /etc/rc.conf, so you do not need to modprobe it everytime you boot. For example, if tg3 is the network module:

MODULES=(... tg3 snd-cmipci ...)

Other common modules are 8139too for cards with the Realtek chipset or sis900 for SiS cards.

Configure IP

It is important to realize that you may have a dynamically assigned address using DHCP or an unchanging "static" address. (see Wikipedia:DHCP for more information)

Note: For motherboards that have integrated NICs, it is important to know which one is considered the primary NIC (e.g. eth0) and which is considered the secondary NIC (e.g. eth1). Many configuration issues are caused by users incorrectly configuring eth0 in their /etc/rc.conf, when in fact, they have their Ethernet cable plugged into eth1.

For DHCP IP

For this option, you need the dhcpcd package (already available on most installations). To make use of it, edit /etc/rc.conf like this:

interface="eth0"
address=
netmask=
gateway=

Only the interface has to be defined, as leaving the other options blank will set network to DHCP.

If you use DHCP and you do not want your DNS servers automatically assigned every time you start your network, be sure to add the following to the last section of /etc/dhcpcd.conf:

nohook resolv.conf

Then add your own DNS nameserver to /etc/resolv.conf.

Make sure to test your new settings by stopping and starting the /etc/rc.d/network daemon, as opposed to bringing down your interface and starting DHCP manually. To restart the network daemon:

# /etc/rc.d/network restart

You may use the openresolv package if several different processes want to control /etc/resolv.conf (i.e. dhcpcd and a VPN client). No additional configuration for dhcpcd is needed to use openresolv.

Note: It is possible to have a static IP using dhcpcd. Simply edit your /etc/conf.d/dhcpcd file to look something like this (where x.x.x.x is your desired IP address):
DHCPCD_ARGS="-q -s x.x.x.x"

For Static IP Addresses

There are various reasons why you may wish to assign static IP addresses on your network. For instance, one may gain a certain degree of predictability. Also, if you share your Internet connection from a Windows box without a router, be sure to use static IP addresses on both computers. Otherwise you will have LAN issues.

You need:

Your static IP address,

The subnet mask,

The broadcast address,

Your gateway's IP address,

Your name servers' IP addresses,

Your domain name (unless a local LAN, in which case you can make it up).

If you are running a private network, it is safe to use IP addresses in 192.168.*.* for your IP addresses, with a netmask of 255.255.255.0 and a broadcast address of 192.168.*.255. Unless your network has a router, the gateway IP address does not matter. Edit /etc/rc.conf like this, substituting your own values for the IP address, netmask, broadcast, and gateway:

Firewall

Wireless Setup

Laptops, 'ifplugd'

You can install a daemon which will automatically configure your Ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. Another use is when you just need to restart the network but do not want to restart the computer or do it from the shell.

IP aliasing

If you want to use multiple IP addresses on an interface, you will have to use netcfg and its POST_UP and PRE_DOWN commands in your network profile to set up the additional IP addresses manually. See here for details.

For some people, the dhclient package (available in [extra]) works where dhcpcd fails.

Swapping computers on the cable modem

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 or equipment 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.

The TCP window scaling issue

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.

Back in 1992, as more and more memory became available, 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.

That 8-bit Scale Factor allows the Window to be up to 32 times higher than the initial 64Kb.

It appears that some broken routers and firewalls on the Internet are rewriting the Scale Factor to 0 which causes misunderstandings between hosts.

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.

The resulting connection is at best very slow or broken.

How to diagnose the problem

First of all, lets 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).

When you have this problem, the dmesg's output is OK, logs are clean and ip addr will report normal status — and actually everything appears normal.

If you cannot browse any website, but you can ping some random hosts, chances are great that you're experiencing this issue: ping uses ICMP and is not affected by TCP issues.

You can try to use Wireshark. You might see successful UDP and ICMP communications but unsuccessful TCP communications (only to foreign hosts).

How to fix it (The bad way)

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 is not guaranteed, especially for very distant ones.

echo "4096 87380 174760" > /proc/sys/net/ipv4/tcp_rmem

How to fix it (The good way)

Simply disable Window Scaling. Since Window Scaling is a nice TCP feature, it may be uncomfortable to disable it, especially if you cannot fix the broken router. There are several ways to disable Window Scaling, and it seems that the most bulletproof way (which will work with most kernels) is to add the following line to /etc/sysctl.conf (see also sysctl)

net.ipv4.tcp_window_scaling = 0

How to fix it (The best way)

This issue is caused by broken routers/firewalls, so lets change them. Some users have reported that the broken router was their very own DSL router.

More about it

Interface names varying

Your network cards are sometimes named differently between two reboots. Configuring your network connection is hard if you do not know if your card will be called eth0 or eth1.
You can fix this using ifrename, see Rename network interfaces

It is also possible to manually create udev rules that assign interface names based on the interface's MAC address.

Realtek no link / WOL issue

Users with Realtek 8168 8169 8101 8111(C) 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 notice if this issue is affecting you if the Link light remains off until Windows boots up; during Windows shutdown the Link light will switch 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 operative systems without newer drivers (eg. Live CDs). Here are a few fixes for this issue:

Method 1 - Rollback/change Windows driver

You can roll back your Windows NIC driver to the Microsoft provided one (if available), or roll back/install an official Realtek driver pre-dating May 2007 (may be on the CD that came with your hardware).

Method 2 - Enable WOL in Windows driver

Probably the best and the 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 CDs, other operative systems). 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.

Note: Newer Realtek Windows drivers (tested with Realtek 8111/8169 LAN Driver v5.708.1030.2008, dated 2009/01/22, available from GIGABYTE) may refer to this option slightly differently, like Shutdown Wake-On-LAN --> Enable. It seems that switching it to Disable has no effect (you will notice the Link light still turns off upon Windows shutdown). One rather dirty workaround is to boot to Windows and just reset the system (perform an ungraceful restart/shutdown) thus not giving the Windows driver a chance to disable LAN. The Link light will remain on and the LAN adapter will remain accessible after POST - that is until you boot back to Windows and shut it down properly again.

Method 3 - Newer Realtek Linux driver

Any newer driver for these Realtek cards can be found for Linux on the realtek site. (untested but believed to also solve the problem).

Method 4 - Enable LAN Boot ROM in BIOS/CMOS

It appears that setting Integrated Peripherals --> Onboard LAN Boot ROM --> Enabled in BIOS/CMOS reactivates the Realtek LAN chip on system boot-up, despite the Windows driver disabling it on OS shutdown.
This was tested successfully multiple times with GIGABYTE system board GA-G31M-ES2L with BIOS version F8 released on 2009/02/05. YMMV.

DLink G604T/DLink G502T DNS issue

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

How to diagnose the problem

The best way to diagnose the problem is to use 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.

Firstly, enable wget for pacman (since it gives us info about pacman when it is downloading packages)
Open /etc/pacman.conf with your favourite editor and uncomment the following line (remove the # if it is there)

XferCommand=/usr/bin/wget --passive-ftp -c -O %o %u

While you are editing /etc/pacman.conf, check the default mirror that pacman uses to download packages.

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),

then you most likely have this problem. The 1.0.0.0 means it is unable to resolve DNS, so we must add it to /etc/resolv.conf.

How to fix it

Basically what we need to do is to manually add the DNS servers 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 from doing this.

When you open /etc/conf.d/dhcpcd, you should see something close to the following:

DHCPCD_ARGS="-t 30 -h $HOSTNAME"

Add the -R flag to the arguments, e.g.

DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"

Note: If you are using dhcpcd >= 4.0.2, the -R flag has been deprecated. Please see the #For DHCP IP section for information on how to use a custom /etc/resolv.conf file.

Save and close the file; now open /etc/resolv.conf. You should see a single nameserver (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 servers of your ISP. Paste the IP address into your browser and log in to your router. Go to the DNS section, and you should see an IP address in the Primary DNS Server field; copy it and paste it as a nameserver ABOVE the current gateway one.

E.g. a /etc/resolv.conf should look something along the lines of

nameserver 10.1.1.1

If my primary DNS server is 211.29.132.12, then change /etc/resolv.conf to

nameserver 211.29.132.12
nameserver 10.1.1.1

Now restart the network daemon by doing /etc/rc.d/network restart and do pacman -Syy. If it syncs correctly with the server, then the problem is solved.

More about it

This is the whirlpool forum (Australian ISP community) which talks about and gives the same solution to the problem

Get an IP from the wrong DHCP in linked (by VPN) router cases

In my case, I have a network where two routers are tied together through VPN. I have one router at my home, and one at a completely different place in the world. In some rare cases, it appears that the router that is connected to me by VPN is assigning me an IP address. I do not know a way to prevent that process, but I do know a way to fix it. On a console, as root, try this:

dhcpcd -k
dhcpcd

The first line releases your IP and the next line requests a new one. I had to run those two commands three times till my issue was fixed, so do not expect it to work after just one try. If that also fails, you might need to disconnect the VPN connection and try it again with the commands above.