Каталог статей
Меню сайта


Форма входа


Категории раздела
Oracle DB [72]
Materials concerning Oracle database
Howto [24]
Все про Oracle [65]
Разработка на SQL и PL/SQL для Oracle, анализ работы базы
Построение Web-интерфейса: все что касается JSF, ADF и AJAX [9]
Разное [19]
Solaris [46]
Что касается администрирования Solaris
Linux [29]
Заметки по настройке Linux
AIX [1]
AIX, настройка Oracle на AIX
Java [15]
Cryptography [10]
Windows [1]
Java [35]
PostgreSQL [2]


Поиск


Друзья сайта
  • Официальный блог
  • Сообщество uCoz
  • FAQ по системе
  • Инструкции для uCoz


  • Статистика

    Онлайн всего: 1
    Гостей: 1
    Пользователей: 0


    Приветствую Вас, Гость · RSS 20.05.2024, 09:49
    Главная » Статьи » Linux

    Исходящий IP в Linux
    Как проверить:
     

    Suppose you have one or more network interfaces, and they have one or more assigned IP addresses, also called aliases. If you need to find out which IP address and interface will be used as a default "source” by your Linux box, you need to execute the following: view source
    print?

    ip route get 8.8.8.8

    This, of course, assumes that 8.8.8.8 is not directly connected on your networks somehow. Since this is one of the Public Name Servers of Google, I think it is safe to assume so.
    A sample output of the ip command follows: view source
    print?

    8.8.8.8 via 10.0.2.2 dev eth0 src 10.0.2.15
    cache
     
    Как поменять:

    If you setup an IP aliases (e.g., eth0:0, eth0:1) on a single NIC, by default the primary IP assigned to the NIC (eth0) will be used as the source IP for all outbound traffic.
    Where:
    eth0:0 - 172.16.0.10
    external host - xxx.xxx.xxx.xxx
    external net - xxx.xxx.xxx.x/xx
    Specify what IP should be used for outbound traffic on a specific host:
     
    # route add -host xxx.xxx.xxx.xxx dev eth0:0
    All traffic destined to host xxx.xxx.xxx.xxx will be routed to eth0:0, thus the outgoing IP will be 172.16.0.10.

    Specify what IP should be used for outbound traffic on a specific network:
     
    # route add -net xxx.xxx.xxx.x/xx dev eth0:0

    чтобы сделать изменения постоянными (после перезагрузки), нужно еще добавить в файл
    /etc/sysconfig/network-scripts/route-eth0 (eth1, eth2 - по обстоятельствам)
    строку
    xxx.xxx.xxx.xxx/32 via yyy.yyy.yyy.yyy dev eth0
     
    где xxx.xxx.xxx.xxx - IP адрес назначения, а yyy.yyy.yyy.yyy - маршрутизатор для eth0
     




     
    Категория: Linux | Добавил: basil (12.05.2012)
    Просмотров: 465 | Комментарии: 1 | Рейтинг: 0.0/0
    Всего комментариев: 0
    Имя *:
    Email *:
    Код *:
    Бесплатный конструктор сайтов - uCoz