Criei uma sub-interface em uma caixa RHEL, eth0:1
copiei a eth0
configuração e alterei todas as configurações para refletir eth0:1
e o endereço IP. No entanto, quando emito ifup eth0:1
, recebo este erro:
[root@server-1 ~]# ifup eth0:1
Error, some other host already uses address 192.168.0.2.
[root@server-1 ~]# ping -c 1 192.168.0.2
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
--- 192.168.0.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 10000ms
No entanto, quando eu emito: ifconfig eth0:1 192.168.0.2 up
o comando funciona e sem erros. Eu usaria o comando posterior, mas quando o utilizo, ele interfere na minha eth0
interface primária e atrapalha o roteamento do tráfego DNS porque está na mesma sub-rede que a sub-interface eth0:1
. Vou fazer outro post sobre o problema do DNS.
Estas são as configurações das interfaces
[root@server-1 network-scripts]# cat ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:50:56:AF:0C:06"
IPADDR="192.168.0.1"
IPV6INIT="yes"
NETMASK="255.255.255.0"
ONBOOT="yes"
TYPE="Ethernet"
DNS1="192.168.2.10"
DNS2="192.168.3.10"
[root@server-1 network-scripts]# cat ifcfg-eth0:1
DEVICE="eth0:1"
BOOTPROTO="static"
HWADDR="00:50:56:AF:0C:06"
IPADDR="192.168.0.2"
IPV6INIT="yes"
NETMASK="255.255.255.0"
ONBOOT="no"
TYPE="Ethernet"
DNS1="192.168.2.10"
DNS2="192.168.3.10"
ip addr show
[root@server-1 network-scripts]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:AF:0c:06 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/24 brd 192.168.0..255 scope global eth0
inet 192.168.2.1/30 brd 192.168.2.3 scope global eth0:2
inet 192.168.2.5/30 brd 192.168.2.7 scope global eth0:3
inet6 fe80::250:56ff:fe97:c06/64 scope link
valid_lft forever preferred_lft forever
ifcfg-eth0:1
arquivo?