This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
настройка_сети_в_ubuntu [2009/11/30 16:49] val |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Настройка сети в Ubuntu ====== | ||
- | |||
- | ===== Файлы конфигурации ===== | ||
- | |||
- | ==== Файл /etc/udev/rules.d/70-persistent-net.rules ==== | ||
- | <code> | ||
- | ... | ||
- | # 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" | ||
- | ... | ||
- | </code> | ||
- | |||
- | ==== Файл /etc/network/interfaces ==== | ||
- | <code> | ||
- | auto lo | ||
- | iface lo inet loopback | ||
- | |||
- | auto eth0 | ||
- | iface eth0 inet static | ||
- | address 172.16.1.13 | ||
- | 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 | ||
- | </code> | ||
- | |||
- | ==== Файл /etc/hostname ==== | ||
- | <code> | ||
- | g13.d13.class | ||
- | </code> | ||
- | |||
- | ==== Файл /etc/hosts ==== | ||
- | <code> | ||
- | 127.0.0.1 localhost | ||
- | |||
- | 192.168.13.1 g13.d13.class g13 | ||
- | 172.16.1.50 g50 | ||
- | </code> | ||
- | |||
- | ==== Файл /etc/resolv.conf ==== | ||
- | <code> | ||
- | domain d13.class | ||
- | nameserver 172.16.1.50 | ||
- | </code> | ||
- | |||
- | ===== Команды для настройки ===== | ||
- | <code> | ||
- | root@g13:~# /etc/init.d/networking restart | ||
- | </code> | ||
- | ===== Команды для диагностики ===== | ||
- | <code> | ||
- | # mii-tool | ||
- | |||
- | # ethtool eth0 | ||
- | |||
- | # netstat -apn | ||
- | |||
- | # netstat -apn --tcp | ||
- | </code> | ||