Пятница, 27.12.2024
TiM
Меню сайта
Категории раздела
Мои статьи [9]
1С Бухгалтерия [1]
Arduino / ATMEGA [10]
ESP8266 [1]
OrangePi PC и Raspberry Pi 2 Model B V1.1 [4]
Шаговые двигатели [1]
PHPProBid [0]
CMS DLE (DataLife Engine) [0]
CMS Joomla [13]
SugarCRM [5]
Базы данных [5]
PHP скрипты [16]
Bash и скрипты [27]
IP АТС Elastix / Asterisk [12]
CentOS [6]
Debian [8]
Lubuntu / LinuxMINT [29]
Windows [28]
Умный дом [1]
Сервера [16]
Natural Selection [1]
System Shock 2 [1]
Форма входа
Главная » Статьи » Debian

Debian: Множество ip адресов на одном сетевом интерфейсе

This /etc/network/interfaces text assigns three IP addresses to eth0.

auto eth0
allow-hotplug eth0
iface eth0 inet static
 address 192.168.1.42
 netmask 255.255.255.0
 gateway 192.168.1.1

auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
 address 192.168.1.43
 netmask 255.255.255.0

auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
 address 192.168.1.44
 netmask 255.255.255.0

 

An alias interface should not have "gateway" or "dns-nameservers"; dynamic IP assignment is permissible.

The above configuration is the previous traditional method that reflects the traditional use of ifconfig to configure network devices. ifconfig has introduced the concept of aliased or virtual interfaces. Those types of virtual interfaces have names of the form interface:integer and ifconfig treats them very similarly to real interfaces.

Nowadays ifupdown uses ip utility from the iproute2 package instead of ifconfig. The newer ip utility does not use the same concept of aliases or virtual interfaces. However, it supports assigning arbitrary names to the interfaces (they're called labels). ifupdown uses this feature to support aliased interfaces while using ip.

Also, ifupdown supports specifying multiple interfaces by repeating iface sections with the same interface name. The key difference from the method described above is that all such sections are treated by ifupdown as just one interface, so user can't add or remove them individually. However, up/down commands, as well as scripts, are called for every section as it used to be.

This /etc/network/interfaces text assigns three IP addresses to eth0.

auto eth0
allow-hotplug eth0
iface eth0 inet static
 address 192.168.1.42
 netmask 255.255.255.0
 gateway 192.168.1.1

iface eth0 inet static
 address 192.168.1.43
 netmask 255.255.255.0

iface eth0 inet static
 address 192.168.1.44
 netmask 255.255.255.0

 

Источник: https://wiki.debian.org/ru/NetworkConfiguration

Категория: Debian | Добавил: Timur (11.05.2016)
Просмотров: 1062
Поиск
Статистика

Онлайн всего: 4
Гостей: 4
Пользователей: 0
YANDEX
Яндекс.Метрика
Сайты
  • Харьковский Юридический Альянс
  • Оцифровка кинопленки
  • TiM ©
    Харьков 2024