User Tools

Site Tools


настройка_сети_в_centos_sl

This is an old revision of the document!


Настройка сети в CentOS SL

Файлы конфигурации

Файл /etc/sysconfig/network-scripts/ifcfg-ethN

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
BROADCAST=195.19.52.255
HWADDR=00:0C:29:C0:F8:54
IPADDR=195.19.52.5
NETMASK=255.255.255.0
NETWORK=195.19.52.0
ONBOOT=yes

Применить изменения конфиги:

# ifdown eth0

# ifup eth0

Файл /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=h5.net52.bmstu.ru
GATEWAY=195.19.52.1

Файл /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1                     localhost6.localdomain6 localhost6
195.19.52.5             h5.net52.bmstu.ru h5

Файл /etc/resolv.conf

search net52.bmstu.ru
nameserver 195.19.32.2

Команды для настройки

root@gate:~# ip addr show dev eth1

root@gate:~# ip addr add 192.168.13.254/24 dev eth1

root@gate:~# ip addr del 192.168.13.254/24 dev eth1

Команды для диагностики

# ethtool eth0

# netstat -apn

# netstat -apn --tcp
настройка_сети_в_centos_sl.1263469281.txt.gz · Last modified: 2013/05/22 13:50 (external edit)