CentOS вторая сетевая как eth0

Материал из poiuty wiki
Перейти к: навигация, поиск

Сетевая карта от realtek *вылетает* при большом количестве kpps.
Можно попробовать установить драйвер r8168. Но чаще всего лучше просто заменить сетевую карту.

Sum 32.897 flows/300s (109 flows/s), 33.008.000 packets/300s (110.026 packets/s), 0,883 GByte/300s (24 MBit/s)
Nov 15 19:58:37 mercury kernel: [2213896.938002] __ratelimit: 61 callbacks suppressed
Nov 15 19:59:19 mercury kernel: [2213939.167431] __ratelimit: 88 callbacks suppressed
Nov 15 20:00:16 mercury kernel: [2213996.839943] ------------[ cut here ]------------
Nov 15 20:00:16 mercury kernel: [2213996.840049] WARNING: at net/sched/sch_generic.c:267 dev_watchdog+0x26b/0x280() (Not tainted)
Nov 15 20:00:16 mercury kernel: [2213996.840222] Hardware name: MS-7823
Nov 15 20:00:16 mercury kernel: [2213996.840307] NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out
Nov 15 20:00:16 mercury kernel: [2213996.840401] Modules linked in: ipt_MASQUERADE xt_state iptable_nat tun vzethdev pio_kaio pio_nfs pio_direct pfmt_raw pfmt_ploop1 ploop simfs vzrst nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 vzcpt nfs lockd fscache auth_rpcgss nfs_acl sunrpc nf_conntrack vziolimit vzdquota ip6t_REJECT ip6table_mangle ip6table_filter ip6_tables xt_length xt_hl xt_tcpmss xt_TCPMSS iptable_mangle iptable_filter xt_multiport xt_limit xt_dscp ipt_REJECT ip_tables vzevent vznetdev vzmon vzdev ipv6 ext3 jbd freq_table mperf intel_pstate ppdev parport_pc parport sg serio_raw iTCO_wdt iTCO_vendor_support r8169 mii i2c_i801 i2c_core lpc_ich mfd_core shpchp ext4 jbd2 mbcache raid1 video output sd_mod crc_t10dif wmi ahci xhci_hcd dm_mirror dm_region_hash dm_log dm_mod [last unloaded: scsi_wait_scan]
Nov 15 20:00:16 mercury kernel: [2213996.841451] Pid: 0, comm: swapper veid: 0 Not tainted 2.6.32-042stab111.12 #1
Nov 15 20:00:16 mercury kernel: [2213996.841614] Call Trace:
Nov 15 20:00:16 mercury kernel: [2213996.841694]  <IRQ>  [<ffffffff8107c927>] ? warn_slowpath_common+0x87/0xc0
Nov 15 20:00:16 mercury kernel: [2213996.841799]  [<ffffffff8107ca16>] ? warn_slowpath_fmt+0x46/0x50
Nov 15 20:00:16 mercury kernel: [2213996.841892]  [<ffffffff81492b6b>] ? dev_watchdog+0x26b/0x280
Nov 15 20:00:16 mercury kernel: [2213996.841989]  [<ffffffff810907dc>] ? run_timer_softirq+0x1bc/0x380
Nov 15 20:00:16 mercury kernel: [2213996.842084]  [<ffffffff81492900>] ? dev_watchdog+0x0/0x280
Nov 15 20:00:16 mercury kernel: [2213996.842176]  [<ffffffff81034ead>] ? lapic_next_event+0x1d/0x30
Nov 15 20:00:16 mercury kernel: [2213996.842270]  [<ffffffff81085d8d>] ? __do_softirq+0x10d/0x250
Nov 15 20:00:16 mercury kernel: [2213996.842364]  [<ffffffff8100c4cc>] ? call_softirq+0x1c/0x30
Nov 15 20:00:16 mercury kernel: [2213996.842455]  [<ffffffff810102f5>] ? do_softirq+0x65/0xa0
Nov 15 20:00:16 mercury kernel: [2213996.842547]  [<ffffffff81085bad>] ? irq_exit+0xcd/0xd0
Nov 15 20:00:16 mercury kernel: [2213996.842638]  [<ffffffff81541d1a>] ? smp_apic_timer_interrupt+0x4a/0x60
Nov 15 20:00:16 mercury kernel: [2213996.842731]  [<ffffffff8100bcd3>] ? apic_timer_interrupt+0x13/0x20
Nov 15 20:00:16 mercury kernel: [2213996.842823]  <EOI>  [<ffffffff812fceae>] ? intel_idle+0xde/0x170
Nov 15 20:00:16 mercury kernel: [2213996.842920]  [<ffffffff812fce91>] ? intel_idle+0xc1/0x170
Nov 15 20:00:16 mercury kernel: [2213996.843018]  [<ffffffff81438a27>] ? cpuidle_idle_call+0xa7/0x140
Nov 15 20:00:16 mercury kernel: [2213996.843115]  [<ffffffff8100a026>] ? cpu_idle+0xb6/0x110
Nov 15 20:00:16 mercury kernel: [2213996.843206]  [<ffffffff815307d4>] ? start_secondary+0x2be/0x301
Nov 15 20:00:16 mercury kernel: [2213996.843296] ---[ end trace d1b82093cbe937ce ]---
Nov 15 20:00:16 mercury kernel: [2213996.852109] r8169 0000:02:00.0: eth0: link up
Nov 15 20:00:28 mercury kernel: [2214008.865592] __ratelimit: 96990 callbacks suppressed
Nov 15 20:00:28 mercury kernel: [2214008.865713] r8169 0000:02:00.0: eth0: link up
Nov 15 20:00:40 mercury kernel: [2214020.887205] __ratelimit: 183 callbacks suppressed

И так, сотрудники дата центра установили вторую сетевую карту.

# lspci | grep Ethernet 
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
03:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

Загружаемся через rescue, монтируем раздел.

mount /dev/md1 /mnt

Открываем /mnt/etc/udev/rules.d/70-persistent-net.rules

# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="44:8a:5b:d8:83:da", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x10d3 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:05:ca:0c:bc:dd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Меняем номер ethN.

# PCI device 0x8086:0x10d3 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:05:ca:0c:bc:dd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="44:8a:5b:d8:83:da", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Проверяем настройки сети /mnt/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
HWADDR=68:05:CA:0C:BC:DD
IPADDR=46.4.60.106
NETMASK=255.255.255.255
SCOPE="peer 46.4.60.105"
IPV6INIT=yes
IPV6ADDR=2a01:4f8:140:50ee::2/64
IPV6_DEFAULTGW=fe80::1
IPV6_DEFAULTDEV=eth0

Перезагружаем сервер и проверяем сетевую карту.

# ethtool -i eth0
driver: e1000e
version: 3.2.5-k
firmware-version: 1.8-0
bus-info: 0000:03:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no