Eu tenho um enigma e gostaria de ouvir qualquer ponteiros
nisso por 2 dias agora, e precisa colocar esse servidor na produção).
Meu "google-foo" não tem sido strong com este.
Eu tenho um servidor Linux multi-homed - Centos 6.x
Eu removi o LACP / bonding nas portas de 10 Gig duplas neste servidor.
Apesar de tentar configurar rotas ip separadas para cada NIC, everyhing
está saindo via NIC em3 (a rota padrão para o sistema). o que
Eu gostaria de ter este sistema se comportando como é para:
- em3 to only handle external (internet) traffic.
- em2 to only handle 10 Gig traffic
- em1 to handle everything else / internal traffic.
O próximo salto nas redes é:
- em1 & em2 go to a good L2/L3, 10 Gig switch
- em3 goes to a decent L2/L3, 1 Gig switch
OBSERVAÇÃO: os endereços IP foram alterados um pouco.
em1 é uma rede interna de 1 Gig que tem direitos para ver tudo
em nossa rede interna, bem como a capacidade de sair para o
abra a internet através do nosso firewall / roteador padrão.
em1 is 10.10.18.21/16 gw is to be 10.10.5.1
em2 é uma rede interna de 10 Gig que serve apenas para ver outras
10 dispositivos Gig nesse segmento de rede.
em2 is 10.16.64.21/26 gw is to be 10.16.64.21
em3 é uma rede externa que permite conexões remotas para
usuários autorizados.
em3 is 10.48.61.80/24 gw is to be 10.48.61.1
Eu adicionei entradas no arquivo / etc / iproute / rt_tables da seguinte forma:
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
10 em1table
20 em2table
30 em3table
Eu também criei arquivos "routes" e "rules".
-rw-r--r-- 1 root root 98 Feb 15 08:54 route-em1
-rw-r--r-- 1 root root 87 Feb 16 12:31 route-em2
-rw-r--r-- 1 root root 102 Feb 16 10:37 route-em3
-rw-r--r-- 1 root root 65 Feb 15 08:11 rule-em1
-rw-r--r-- 1 root root 68 Feb 16 12:32 rule-em2
-rw-r--r-- 1 root root 68 Feb 16 10:37 rule-em3
[/etc/sysconfig/network-scripts]$ cat route-em1
10.10.18.0 dev em1 src 10.10.18.21 table em1table
default via 10.10.5.1 dev em1 table em1table
[/etc/sysconfig/network-scripts]$ cat rule-em1
from 10.10.18.21/16 table em1table
to 10.10.5.1 table em1table
[/etc/sysconfig/network-scripts]$ cat route-em2
10.16.64.0/28 dev em2 table em2table
default via 10.16.64.254 dev em2 table em2table
[/etc/sysconfig/network-scripts]$ cat rule-em2
from 10.16.64.21/28 table em2table
to 10.16.64.254 table em2table
67.134
[/etc/sysconfig/network-scripts]$ cat route-em3
10.48.161.0 dev em3 src 10.48.161.82 table em3table
default via 10.48.161.1 dev em3 table em3table
[/etc/sysconfig/network-scripts]$ cat rule-em3
from 10.48.161.82/24 table em3table
to 10.48.161.1 table em3table
[/etc/sysconfig/network-scripts]$ ip route show table em1table
10.10.18.0 dev em1 scope link src 10.10.18.21
default via 10.10.5.1 dev em1
[/etc/sysconfig/network-scripts]$ ip route show table em2table
10.16.64.0/28 dev em2 scope link
default via 10.16.64.254 dev em2
[/etc/sysconfig/network-scripts]$ ip route show table em3table
10.48.161.0 dev em3 scope link src 10.48.161.82
default via 10.48.161.1 dev em3
Aqui estão algumas informações adicionais:
[/etc/sysconfig/network-scripts]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.48.161.0 0.0.0.0 255.255.255.0 U 0 0 0 em3
10.16.64.0 0.0.0.0 255.255.192.0 U 0 0 0 em2
10.10.0.0 0.0.0.0 255.255.0.0 U 0 0 0 em1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 em1
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 em2
169.254.0.0 0.0.0.0 255.255.0.0 U 1004 0 0 em3
0.0.0.0 10.48.161.1 0.0.0.0 UG 0 0 0 em3
[/etc/sysconfig/network-scripts]$
[/etc/sysconfig/network-scripts]$ ip route show
10.48.161.0/24 dev em3 proto kernel scope link src 10.48.161.82
10.16.64.0/18 dev em2 proto kernel scope link src 10.16.64.21
10.10.0.0/16 dev em1 proto kernel scope link src 10.10.18.21
169.254.0.0/16 dev em1 scope link metric 1002
169.254.0.0/16 dev em2 scope link metric 1003
169.254.0.0/16 dev em3 scope link metric 1004
default via 10.48.161.1 dev em3
[/etc/sysconfig/network-scripts]$
[/etc/sysconfig/network-scripts]$ ip route show to match 10.16.64.0/28
10.16.64.0/18 dev em2 proto kernel scope link src 10.16.64.21
default via 67.134.161.1 dev em3
[/etc/sysconfig/network-scripts]$ ip route show to match 10.10.18.0/16
10.10.0.0/16 dev em1 proto kernel scope link src 10.10.18.21
default via 67.134.161.1 dev em3
[/etc/sysconfig/network-scripts]$ ip route show to match 67.134.161.0/24
10.48.161.0/24 dev em3 proto kernel scope link src 10.48.161.82
default via 10.48.161.1 dev em3
[/etc/sysconfig/network-scripts]$ cat ifcfg-em1
DEVICE=em1
#MASTER=bond0
#SLAVE=yes
HWADDR=c8:1f:66:f4:ce:10
TYPE=Ethernet
UUID=bfa14e4a-66b0-4b83-93a4-094f9090aea7
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=10.10.18.21
PREFIX=16
#GATEWAY=10.10.5.1
DNS1=10.10.5.8
DNS2=10.10.5.9
DOMAIN=AXS
DEFROUTE=YES
IP4_FAILURE_FATAL=yes
IP6INIT=no
NAME="em1"
NETMASK=255.255.0.0
IPV6INIT=no
USERCTL=no
[/etc/sysconfig/network-scripts]$ cat ifcfg-em2
DEVICE=em2
#MASTER=bond0
#SLAVE=yes
HWADDR=c8:1f:66:f4:ce:12
TYPE=Ethernet
UUID=c8c5e1fb-ba40-4537-89ad-f7df5de59f8b
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=10.16.64.21
PREFIX=18
#GATEWAY=10.16.64.254
DNS1=10.10.5.8
DNS2=10.10.5.9
DOMAIN=AXS
#DEFROUTE=YES
IP4_FAILURE_FATAL=yes
IP6INIT=no
NAME="em2"
#IPADDR=10.16.64.21
NETMASK=255.255.192.0
IPV6INIT=no
USERCTL=no
[/etc/sysconfig/network-scripts]$ cat ifcfg-em3
DEVICE=em3
HWADDR=C8:1F:66:F4:CE:14
TYPE=Ethernet
UUID=aa9552be-0075-46b2-8eff-b7c49c8c999f
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=10.48.161.82
PREFIX=24
GATEWAY=10.48.161.1
DNS1=10.10.5.8
DNS2=10.10.5.9
DNS3=205.171.3.65
DNS4=8.8.8.8
DOMAIN=axs.tv
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
USERCTL=no
E quando tento fazer ping em cada interface:
[/etc/sysconfig/network-scripts]$ ping -I em1 10.10.5.1
PING 10.10.5.1 (10.10.5.1) from 10.10.18.21 em1: 56(84) bytes of data.
--- 10.10.5.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2846ms
rtt min/avg/max/mdev = 0.081/0.101/0.135/0.024 ms
[/etc/sysconfig/network-scripts]$ ping -I em2 10.16.64.154
PING 10.16.64.154 (10.16.64.154) from 10.16.64.21 em2: 56(84) bytes of data.
--- 10.16.64.154 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4022ms
pipe 3
[/etc/sysconfig/network-scripts]$ ping -I em3 www.google.com
--- www.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3366ms
rtt min/avg/max/mdev = 2.657/2.679/2.711/0.041 ms