ky是什么| 脚臭是什么原因引起的| 转氨酶高对身体有什么影响| 尚清是什么意思| 备孕吃什么好| 三月一日是什么星座| 前庭神经炎挂什么科| 肚子胀是什么原因| 洋盘是什么意思| 邓超属什么生肖| 卵巢增大是什么原因引起的| 胆是起什么作用的| 土地出让是什么意思| 卧榻是什么意思| 圣代是什么| 急性腮腺炎吃什么药| 肝气不舒吃什么中成药| 马后炮是什么意思| 心跳过缓是什么原因造成的| 咽喉炎是什么原因引起的| 怀孕初期怕冷是什么原因| 唇炎涂什么药膏| 出炉是什么意思| 身上发抖是什么原因| 大姨夫是什么意思| 双非是什么| 康复治疗学学什么| 柳是什么生肖| 古怪是什么意思| 为什么小鸟站在电线上不会触电| 喉咙扁桃体发炎吃什么药| 头晕吃什么药| 胃溃疡不能吃什么食物| 桥本甲状腺炎有什么症状表现| 中国第一艘航空母舰叫什么| 什么的枫树| 烂好人是什么意思| 1998年属虎是什么命| 褪黑素是什么东西| 安全起见是什么意思| 上不下大是什么字| 立加羽念什么| 副省长什么级别| 验大便能查出什么| 颈椎病吃什么药效果好| 耳朵痛什么原因| 银行卡开户名是什么| 乳房头疼是什么原因| 什么什么不乐| 乙酰氨基葡萄糖苷酶阳性什么意思| 征求是什么意思| 转移灶是什么意思| 口干是什么原因呢| 如是什么意思| 什么药可降尿酸| 维生素b5药店叫什么| 一心一意指什么生肖| 产瘤是什么意思| 岫玉是什么| 胃胀气吃什么药| 张郃字什么| 主动脉硬化什么意思| 红细胞阳性是什么意思| 四平八稳是什么生肖| 石字旁有什么字| 胃病忌什么| 节节草有什么功效| 什么是对的人| 肠管积气是什么原因| 有什么瓜| 尿频是什么原因| 什么病不能吃西洋参| 被螨虫咬了擦什么药膏| 他喵的什么意思| 第一颗原子弹叫什么| 相害是什么意思| 什么是畸胎瘤| 朗朗原名叫什么| 卵圆孔未闭是什么病| 凉皮什么做的| 护士学什么专业| 闭口长什么样子| 烧心是什么原因| 黄豆芽炒什么好吃| 血糖高什么东西不能吃| 双减是什么意思| 心率快吃什么药效果更佳| 胃疼是什么症状| 1989年出生是什么命| 痛经 吃什么| 肌炎有什么症状| 戴珍珠手链有什么好处| 腋下看什么科| 风湿性心脏病是什么原因引起的| 什么血型招蚊子咬| 为什么大便拉不出来| 神经衰弱吃什么药好| 嗓子痛吃什么药好得快| 拉肚子可以吃什么药| 东北话篮子是什么意思| 臭虫怕什么| 青光眼什么症状| 梦见盖新房子是什么意思| 凝血功能障碍是什么病| 禹字五行属什么的| f00d中文是什么意思| 什么是逆商| 胎儿永存左上腔静脉是什么意思| 灰色t恤配什么颜色裤子| 短发适合什么脸型| 老年人口干是什么原因| 什么叫真爱| 鼠冲什么生肖| 着床出血是什么意思| 月经很少什么原因| 菠萝蜜什么味道| 阿斗是什么意思| 事业是什么意思| 文书是什么| 90年属什么的生肖| 但求无愧于心上句是什么| 胃溃疡有什么症状| 傲慢什么意思| 419是什么意思| rm是什么币| 柱镜是什么意思| 今天什么日| 2016年属什么生肖| model是什么品牌| 包裹是什么意思| 经常流鼻涕是什么原因引起的| 纳粹是什么意思| 益生菌和益生元有什么区别| 突然晕倒是什么原因| 孕早期吃什么好| rap是什么意思| 高温天气喝什么水最好| 海竹是什么| 脾门区结节是什么意思| bp是什么意思| 四个自信是什么| 血糖偏高吃什么水果好| 何炅和谢娜是什么关系| 肌无力吃什么药| 山竹什么时候吃是应季| 风疹病毒igg阳性是什么意思| 阑尾炎打什么消炎针好| 日本有什么好玩的| 舌苔腻是什么意思| 茯苓有什么作用和功效| 粘米粉可以做什么好吃的| 夏天吃什么汤| 天癸是什么意思| 湿疣是什么病| 佟丽娅为什么离婚| 大姨妈期间适合吃什么水果| 挖空细胞是什么意思啊| 牙痛用什么止痛| 姓黑的都是什么族| 资讯是什么意思| 女人梦见蛇是什么意思| 总想小便是什么原因| 玩手机头疼是什么原因| 吃什么会长高| 无后为大的前一句是什么| 梦到绿色的蛇是什么意思| 嘴巴旁边长痘痘是为什么| 生姜什么时候种| 诅咒是什么意思| ntl是什么意思| 2004年出生属什么| 尿血什么原因| 肺结核可以做什么运动| 陈五行属什么| 拔牙之前要注意什么| 茄子炒什么好吃又简单| 炖鸡肉放什么调料| 飞机不能带什么| 冰点是什么意思| 肚脐下四指是什么位置| 什么是普世价值| 激素六项什么时间查最好| moo是什么意思| 口腔上火是什么原因| 企业性质指的是什么| 喝了蜂蜜水不能吃什么| 紧张性头痛吃什么药| 喉结是什么| 甘油三酯高是什么原因| 白垩纪是什么意思| 跑完步喝什么水最好| 翡翠对人体有什么好处| 真菌涂片检查是查什么| 五蕴皆空是什么意思| 缺钾是什么原因引起| 水球是什么| 主意正是什么意思| 鄙视是什么意思| 阴历是什么| 为什么指甲会凹凸不平| 旭五行属什么| 质数是什么| 水晶眼镜对眼睛有什么好处| 戴银首饰对身体有什么好处| 嘴角起痘是什么原因| 糖水是什么| 女性肛门瘙痒用什么药| 过度是什么意思| 材料化学属于什么类| 走仕途是什么意思| lynn是什么意思| 20岁属什么| 吃什么能降血脂| 老年人屁多是什么原因| 朝鲜和韩国是什么关系| 聊表心意是什么意思| 免费查五行缺什么| 陕西为什么叫三秦大地| 吃降压药有什么副作用| 四月十四日是什么节日| 胆囊切除有什么危害| 高温丝假发是什么材质| 高颜值是什么意思| 改名字需要什么手续| 节瓜煲汤放什么材料| 玫瑰什么时候开花| 报工伤需要什么材料| 蜂蜜和柠檬一起喝有什么作用| 11月份什么星座| 吃什么补肺养肺比较好| 胃窦隆起是什么意思| 小娇妻是什么意思| xxl是什么尺码| 胃火旺吃什么药| 空调长时间不用再开注意什么| 8月23是什么星座| 什么人不适合普拉提| 有什么黄色网站| 大理寺卿是什么职位| 前白蛋白偏低是什么意思| 为什么叫黄牛| 胃癌是什么原因引起的| 什么是什么| 血燥是什么意思| 肠手术后吃什么恢复快| 二姨子是什么意思| 什么是陈述句| 表彰是什么意思| 七月初七是什么星座| 丹五行属性是什么| 乳房发烫胀痛什么原因| 撤退性出血是什么意思| 半夜尿多是什么原因| 骑乘是什么意思| 小肚子疼是什么原因引起的| 射进去是什么感觉| 眼睛疲劳用什么眼药水好| 伊索寓言有什么故事| 钧五行属什么| 胚根发育成什么| ct是什么| 涤纶是什么材质| 本科什么意思| 孕妇吃什么坚果比较好| 百度
Jump to content

车讯:可选双边共四出排气 WEY W01申报图曝光

From ArchWiki
(Redirected from Ss)

This article describes how to configure network connections on OSI layer 3 and above. Medium-specifics are handled in the /Ethernet and /Wireless subpages.

Check the connection

This article or section needs expansion.

Reason: Step 4. is unclear, #Routing table does not explain what a correct setup looks like. (Discuss in Talk:Network configuration)

To troubleshoot a network connection, go through the following conditions and ensure that you meet them:

  1. Your network interface is listed and enabled. Otherwise, check the device driver – see /Ethernet#Device driver or /Wireless#Device driver.
  2. You are connected to the network. The cable is plugged in or you are connected to the wireless LAN.
  3. Your network interface has an IP address.
  4. Your routing table is correctly set up.
  5. You can ping a local IP address (e.g. your default gateway).
  6. You can ping a public IP address (e.g. 9.9.9.9, which is a DNS server operated by the Quad9 Foundation and is a convenient address to test with).
  7. Check if you can resolve domain names (e.g. archlinux.org).

Ping

ping is used to test if you can reach a host.

$ ping www.example.com
PING www.example.com (93.184.216.34) 56(84) bytes of data.
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=1 ttl=56 time=11.632 ms
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=2 ttl=56 time=11.726 ms
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=3 ttl=56 time=10.683 ms
...

For every reply received, the ping utility will print a line like the above until you interrupt (Ctrl+c) it interactively. For more information see the ping(8) manual. Note that computers can be configured not to respond to ICMP echo requests. [1]

If you receive an error message (see ping error indications) or no reply, this may be related to incomplete configuration, but also your default gateway or your Internet Service Provider (ISP). You can run a traceroute to further diagnose the route to the host.

Network management

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: Split into manual configuration with iproute2 and automatic with DHCP & SLAAC. (Discuss in Talk:Network configuration#Style_notice_in_Network_Management_section)

To set up a network connection, go through the following steps:

  1. Ensure your network interface is listed and enabled.
  2. Connect to the network. Plug in the Ethernet cable or connect to the wireless LAN.
  3. Configure your network connection:
Note The installation image uses

Manual

iproute2

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: This section does not fit in #Network management – it does not manage anything, it only introduces the iproute2 package. (Discuss in Talk:Network configuration)

iproute2 is a dependency of the base meta package and provides the ip(8) command-line interface, used to manage network interfaces, IP addresses and the routing table. Be aware that configuration made using ip will be lost after a reboot. For persistent configuration, you can automate ip commands using scripts and systemd units. Also note that ip commands can generally be abbreviated, for clarity they are however spelled out in this article.

Note Arch Linux has deprecated net-tools in favor of iproute2.[2] See also Deprecated Linux networking commands and their replacements.

Static IP address

A static IP address can be configured with most standard network managers and also dhcpcd.

To manually configure a static IP address, add an IP address as described in #IP addresses, set up your routing table and configure your DNS servers.

IP addresses

IP addresses are managed using ip-address(8).

List IP addresses:

$ ip address show

Add an IP address to an interface:

# ip address add address/prefix_len broadcast + dev interface
Note that:
Note Make sure manually assigned IP addresses do not conflict with DHCP assigned ones.

Delete an IP address from an interface:

# ip address del address/prefix_len dev interface

Delete all addresses matching a criteria, e.g. of a specific interface:

# ip address flush dev interface
Tip IPv4 addresses can be calculated with ipcalc (ipcalc).

Routing table

The routing table is used to determine if you can reach an IP address directly or what gateway (router) you should use. If no other route matches the IP address, the default gateway is used.

The routing table is managed using ip-route(8).

PREFIX is either a CIDR notation or default for the default gateway.

List IPv4 routes:

$ ip route show

List IPv6 routes:

$ ip -6 route show

Add a route:

# ip route add PREFIX via address dev interface

Delete a route:

# ip route del PREFIX via address dev interface

Automatic

This article or section needs expansion.

Reason: Explain SLAAC. (Discuss in Talk:Network configuration)

Automatic network configuration is accomplished using Dynamic Host Configuration Protocol (DHCP). The network's DHCP server provides IP address(es), the default gateway IP address(es) and optionally also DNS name servers upon request from the DHCP client.

See Router#DNS and DHCP for a DHCP server comparison table.

Network managers

A network manager lets you manage network connection settings in so called network profiles to facilitate switching networks.

Tip You can check if a DHCPv4 server is running with dhcping.
Note Each network interface should be managed by only one DHCP client or network manager, so it is advised to run only one DHCP client or network manager on the system.
Software Connection type Wireless authentication IP address, route and DNS management Interface
Ethernet PPPoE Mobile broadband Static IP DHCP client Domain name resolution CLI TUI GUI
dhclient1 Yes No No No2 Yes internal Yes (writes /etc/resolv.conf) No No No
dhcpcd Yes No No Launches wpa_supplicant3 Yes internal Yes (uses resolvconf or writes /etc/resolv.conf) No No dhcpcd-uiAUR
ConnMan Yes No Yes (via ofonoAUR) Yes (via wpa_supplicant or iwd) Yes internal Yes (runs a builtin resolver and writes /etc/resolv.conf) connmanctl(1) Yes Yes
netctl Yes Yes (via ppp) Yes (via ppp) Yes (via wpa_supplicant) Yes dhcpcd or dhclient Yes (uses resolvconf) netctl(1) wifi-menu(1)4 No
NetworkManager Yes Yes (via ppp) Yes (via modemmanager) Yes (via wpa_supplicant or iwd) Yes internal, dhclient or dhcpcd5 Yes (uses systemd-resolved, resolvconf or writes /etc/resolv.conf) nmcli(1) nmtui(1) Yes
systemd-networkd Yes No No No2 Yes internal Yes (uses systemd-resolved) networkctl(1) No No
wpa_supplicant IEEE 802.1X No No Yes No wpa_cli(8) No wpa_supplicant_guiAUR
iwd IEEE 802.1X No No Yes Yes internal Yes (uses systemd-resolved or resolvconf) iwctl(1) impala iwgtkAUR
  1. No longer maintained as of early 2022. ISC advises no longer using it in production.
  2. Wireless authentication can be configured separately with wpa_supplicant or iwd.
  3. Wireless authentication must be configured separately with wpa_supplicant.
  4. Only Wi-Fi connections can be managed.
  5. NetworkManager does not use dhcpcd for DHCPv6, see NetworkManager#DHCP client.

Network interfaces

Network interfaces are managed by udev and configured by systemd.link(5) files. The default configuration assigns names to your network interface controllers using Predictable Network Interface Names, which prefixes interfaces names with en (wired/Ethernet), wl (wireless/WLAN), or ww (mobile broadband/WWAN). See systemd.net-naming-scheme(7).

Tip
  • The system /usr/lib/systemd/network/99-default.link is generally sufficient for most cases.
  • To change interface names, see #Change interface name and #Revert to traditional interface names.
  • You can run udevadm test-builtin net_setup_link /sys/path/to/network/device as the root user to diagnose problems with .link files.
Note
  • The predictable network interface names can change after adding or removing a PCIe device if the system firmware decides to renumber the devices. See systemd issue 33347.
  • The iwd package contains a .link file that disables predictable network interface names. Merely having it installed will prevent all network interfaces from being renamed to predictable names. See iwd#Wireless device is not renamed by udev.

Listing network interfaces

Both wired and wireless interface names can be found via ls /sys/class/net or ip link. Note that lo is the virtual loopback interface and not used in making network connections.

Wireless device names can also be retrieved using iw dev. See also /Wireless#Get the name of the interface.

If your network interface is not listed, make sure your device driver was loaded successfully. See /Ethernet#Device driver or /Wireless#Device driver.

Enabling and disabling network interfaces

Network interfaces can be enabled or disabled using ip link set interface up|down, see ip-link(8).

To check the status of the interface enp2s0:

$ ip link show dev enp2s0
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN mode DEFAULT qlen 1000
...

The UP in <BROADCAST,MULTICAST,UP,LOWER_UP> is what indicates the interface is up, not the later state DOWN.

Note If your default route is through interface enp2s0, taking it down will also remove the route, and bringing it back up will not automatically re-establish the default route. See #Routing table for re-establishing it.

Change interface name

This article or section needs expansion.

Reason: Suggest using an alternative name (altname), or assigning one, as an alternative to changing the interface name. (Discuss in Talk:Network configuration)
Note When changing the naming scheme, do not forget to update all network-related configuration files and custom systemd unit files to reflect the change.

You can change the device name by defining the name manually with a systemd.link(5) file. The file must be ordered lexicographically before 99-default.link, for example:

/etc/systemd/network/10-net0.link
[Match]
PermanentMACAddress=aa:bb:cc:dd:ee:ff

[Link]
Name=net0

Alternatively, a udev rule can be used:

/etc/udev/rules.d/10-network.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="net0"

These rules will be applied automatically at boot. To apply the change immediately, do a manual trigger of the udev rule on the net subsystem:

# udevadm trigger --verbose --subsystem-match=net --action=add

If you want to run a test on the changes made, udevadm --debug test /sys/class/net/* can be of help.

Note
  • The priority of Name is lower than NamePolicy, so make sure the latter is unset/empty or the name will not be changed.
  • The network interface must be down before changing its name. [3]
  • To get the MAC address of each card, run ip link.
  • Make sure to use the lower-case hex values in your udev rules. It does not like upper-case.

If the network card has a dynamic MAC, you can use Path (which can be checked using networkctl status interface_name):

/etc/systemd/network/10-net1.link
[Match]
Path=pci-0000:01:00.0

[Link]
Name=net1

Or, use a udev rule with DEVPATH:

/etc/udev/rules.d/10-network.rules
SUBSYSTEM=="net", DEVPATH=="/devices/pci*/*1c.0/*/net/*", NAME="net1"

To get the DEVPATH of all currently-connected devices, see where the symlinks in /sys/class/net/ lead. For example:

$ file /sys/class/net/*
/sys/class/net/enp0s20f0u4u1: symbolic link to ../../devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.1/2-4.1:1.0/net/enp0s20f0u4u1
/sys/class/net/enp0s31f6:     symbolic link to ../../devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
/sys/class/net/lo:            symbolic link to ../../devices/virtual/net/lo
/sys/class/net/wlp4s0:        symbolic link to ../../devices/pci0000:00/0000:00:1c.6/0000:04:00.0/net/wlp4s0

The device path should match both the new and old device name, since the rule may be executed more than once on bootup. For example, in the given rule, "/devices/pci*/*1c.0/*/net/en*" would be wrong since it will stop matching once the name is changed to net1. Only the system-default rule will fire the second time around, causing the name to be changed back.

If you are using a USB network device (e.g. Android phone tethering) that has a dynamic MAC address and you want to be able to use different USB ports, you could use a rule that matched depending on vendor and model ID instead:

/etc/systemd/network/20-net2.link
[Match]
Property=ID_VENDOR_ID=12ab ID_MODEL_ID=3cd4

[Link]
Name=net2

or

/etc/udev/rules.d/10-network.rules
SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="12ab", ATTRS{idProduct}=="3cd4", NAME="net2"
Note When choosing the static names it should be avoided to use names in the format of "ethX" and "wlanX", because this may lead to race conditions between the kernel and udev during boot. Instead, it is better to use interface names that are not used by the kernel as default, e.g.: net0, net1, wifi0, wifi1. For further details please see the systemd documentation.

Revert to traditional interface names

If you would prefer to retain traditional interface names such as eth0, Predictable Network Interface Names can be disabled by changing the default NamePolicy for udev's net_setup_link built-in:

/etc/systemd/network/99-default.link.d/traditional-naming.conf
[Link]
NamePolicy=keep kernel

Alternatively, net_setup_link can be completely disabled by masking the corresponding udev rule:

# ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules

or by adding net.ifnames=0 to the kernel parameters.

Note systemd.link(5) relies on net_setup_link to work. Prefer to use the first approach unless you fully understand what you are doing.

Set device MTU and queue length

The factual accuracy of this article or section is disputed.

Reason: Creating a 30-mtu.link file means that 99-default.link will not get applied. (Discuss in Talk:Network configuration)

You can change the device MTU and queue length by defining manually with a systemd.link(5) config. For example:

/etc/systemd/network/30-mtu.link
[Match]
Type=wlan

[Link]
MTUBytes=1500
TransmitQueueLength=2000

Or through a udev rule:

/etc/udev/rules.d/10-network.rules
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wl*", ATTR{mtu}="1500", ATTR{tx_queue_len}="2000"

MTUBytes: Using a value larger than 1500 (so called jumbo frames) can significantly speed up your network transfers. Note that all network interfaces, including switches in the local network, must support the same MTU in order to use jumbo frames. For PPPoE, the MTU should not be larger than 1492. You can also set MTU via systemd.netdev(5).

TransmitQueueLength: Small value for slower devices with a high latency like modem links and ISDN. High value is recommended for server connected over the high-speed internet connections that perform large data transfers.

Set the hostname

A hostname is a unique name created to identify a machine on a network, configured in /etc/hostname—see hostname(5) and hostname(7) for details. The file can contain the system's domain name, if any. To set the hostname, edit /etc/hostname to include a single line with yourhostname:

/etc/hostname
yourhostname
Tip For advice on choosing a hostname, see RFC 1178.

Alternatively, using hostnamectl(1):

# hostnamectl hostname yourhostname

To temporarily set the hostname (until reboot), use hostname(1) from inetutils:

# hostname yourhostname

To set the "pretty" hostname and other machine metadata, see machine-info(5).

Local network hostname resolution

To make your machine accessible in your LAN via its hostname you can:

  • edit the /etc/hosts file for every device in your LAN, see hosts(5)
  • set up a DNS server to resolve your hostname and make the LAN devices use it (e.g. via DHCP)
  • or the easy way: use a Zero-configuration networking service:
    • Hostname resolution via Microsoft's NetBIOS. Provided by Samba on Linux. It only requires the nmb.service. Computers running Windows, macOS, or Linux with nmb running, will be able to find your machine.
    • Hostname resolution via mDNS. Provided by either nss_mdns with Avahi (see Avahi#Hostname resolution for setup details) or systemd-resolved. Computers running macOS, or Linux with Avahi or systemd-resolved running, will be able to find your machine. The older Win32 API does not support mDNS, which may prevent some older Windows applications from accessing your device.

Tips and tricks

Bonding or LAG

See netctl or systemd-networkd, or Wireless bonding.

IP address aliasing

IP aliasing is the process of adding more than one IP address to a network interface. With this, one node on a network can have multiple connections to a network, each serving a different purpose. Typical uses are virtual hosting of Web and FTP servers, or reorganizing servers without having to update any other machines (this is especially useful for nameservers).

Example

To manually set an alias, for some NIC, use iproute2 to execute

# ip addr add 192.168.2.101/24 dev enp2s0 label enp2s0:1

To remove a given alias execute

# ip addr del 192.168.2.101/24 dev enp2s0:1

Packets destined for a subnet will use the primary alias by default. If the destination IP is within a subnet of a secondary alias, then the source IP is set respectively. Consider the case where there is more than one NIC, the default routes can be listed with ip route.

Promiscuous mode

Toggling promiscuous mode will make a (wireless) NIC forward all traffic it receives to the OS for further processing. This is opposite to "normal mode" where a NIC will drop frames it is not intended to receive. It is most often used for advanced network troubleshooting and packet sniffing.

/etc/systemd/system/promiscuous@.service
[Unit]
Description=Set %i interface in promiscuous mode
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/ip link set dev %i promisc on
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

If you want to enable promiscuous mode on interface enp2s0, enable promiscuous@enp2s0.service.

Investigate sockets

ss is a utility to investigate network ports and is part of the iproute2 package. It has a similar functionality to the deprecated netstat utility.

Common usage includes:

Display all TCP Sockets with service names:

$ ss -at

Display all TCP Sockets with port numbers:

$ ss -atn

Display all UDP Sockets:

$ ss -au

For more information see ss(8).

Troubleshooting

The TCP window scaling problem

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 64KiB. 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 64KiB.

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, let us 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 output from dmesg is okay, 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 are experiencing this problem: ping uses ICMP and is not affected by TCP problems.

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

Ways of fixing it

Bad

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.

# sysctl -w net.ipv4.tcp_rmem="4096 87380 174760"
Good

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.d/99-disable_window_scaling.conf (see also sysctl):

net.ipv4.tcp_window_scaling = 0
Best

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

More about it

This section is based on the LWN article TCP window scaling and broken routers and an archived Kernel Trap article: Window Scaling on the Internet.

There are also several relevant threads on the LKML.

local hostname is resolved over the network

nss-myhostname(8) (an NSS module provided by systemd and enabled by default in /etc/nsswitch.conf) provides localhost and the local hostname resolution to an IP address. Some software may, however, still instead read /etc/hosts directly; see [4] [5] for examples.

To prevent such software from unsafely resolving the local hostname over the network, add an entry for it to the hosts(5) file:

/etc/hosts
127.0.0.1        localhost
::1              localhost
127.0.1.1        yourhostname

For a system with a permanent IP address, replace 127.0.1.1 with that permanent IP address. For a system with a fully qualified domain name, insert the fully qualified domain name before the hostname (see the following link for the reasoning). For example:

/etc/hosts
127.0.0.1        localhost
::1              localhost
203.0.113.45     host1.fqdomain.example host1
Note The order of hostnames/aliases that follow the IP address in /etc/hosts is significant. The first string is considered the canonical hostname and may be appended with parent domains, where domain components are separated by a dot. All following strings on the same line are considered aliases. See hosts(5) for more information.

See also

rh血型D阳性是什么意思 5月份什么星座 鼻子下面长痘痘是什么原因引起的 心脏供血不足是什么原因引起的 大尾巴狼是什么意思
简单明了是什么意思 什么是护理 心肌炎吃什么药 肚脐上面疼是什么原因 爆炸盐是什么
中山市有什么大学 囊肿长什么样子图片 螳螂捕蝉什么意思 神经炎是什么症状 头皮长疙瘩是什么原因
摧枯拉朽什么意思 森达属于什么档次的鞋 宁的五行属性是什么 阴道有豆腐渣用什么药 心脏早搏吃什么药
集体户口和个人户口有什么区别hcv8jop6ns0r.cn 鼻炎看什么科hcv7jop6ns9r.cn 解酒喝什么好hcv8jop9ns3r.cn 周二右眼皮跳是什么预兆hcv7jop7ns2r.cn 小腹变大是什么原因hcv8jop4ns9r.cn
衤字旁的字与什么有关hcv8jop2ns4r.cn 罹是什么意思hcv8jop9ns2r.cn 身上起疙瘩是什么原因hcv8jop0ns9r.cn 豆绿色配什么颜色好看hcv9jop1ns3r.cn 火靠念什么bjhyzcsm.com
夜盲症缺什么hcv8jop4ns3r.cn 西瓜对人体有什么好处hcv8jop3ns7r.cn 宝宝不爱喝水有什么好的办法吗hanqikai.com 为什么会突然得荨麻疹hcv8jop6ns5r.cn 吃什么补肾壮阳最快速wuhaiwuya.com
抗原体阳性是什么意思hcv7jop6ns7r.cn 大义灭亲是什么意思hcv8jop9ns6r.cn 黄体期是什么意思hcv8jop8ns3r.cn 寡情是什么意思hcv9jop0ns4r.cn 女性尿浑浊是什么原因hcv9jop4ns3r.cn
百度