User Tools

Site Tools


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

This is an old revision of the document!


Настройка сети в Ubuntu

Настройка "в ручную"

# ifconfig -a
# ethtool eth0
# ifconfig eth0 inet 172.16.1.X/24
# route add default gw 172.16.1.50

# ip addr show dev eth0
# ip addr add 172.16.1.100+X/32 dev eth0
# ip addr del 172.16.1.100+X/32 dev eth0

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

Файл /etc/udev/rules.d/70-persistent-net.rules

...
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:18:7f:01", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
...

Файл /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 172.16.1.X
        netmask 255.255.255.0
        gateway 172.16.1.254

# Alias example
# auto eth0:0
# iface eth0:0 inet static
#         address 192.168.32.25
#         netmask 255.255.255.0

# 802.1q example
# auto vlan10
# iface vlan10 inet static
#        address 192.168.32.141
#        netmask 255.255.255.0
#        mtu 1500
#        vlan_raw_device eth0

Файл /etc/hostname

hostX.class.un

Файл /etc/hosts

127.0.0.1       localhost

172.16.1.X      hostX.class.un hostX
172.16.1.50     gate

Файл /etc/resolv.conf

 
domain class.un
nameserver 172.16.1.50

Применение файлов настроек

root@gate:~# /etc/init.d/networking restart

root@gate:~# hostname hostX.class.un

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

# mii-tool 

# ethtool eth0

# netstat -apn

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