[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Deux ip sur eth0 ?



Le lun, oct 08, 2001, à 03:30:56 +0200, Guillaume Morin a écrit:
> Dans un message du 08 oct à 15:22, RENAULT Laurent écrivait :
> > Deux ip sur eth0 ? Est-ce possible ?
> 
> Ça dépend. Si tu veux absolument 2 IPs pour eth0, c'est impossible. Si

mais si, deux ip pour eth0 proprement dit c'est possible. Juste en utilisant
les bons outils:
  
muscat# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:a0:24:a6:57:a0 brd ff:ff:ff:ff:ff:ff
    inet 10.255.255.1/24 brd 10.255.255.255 scope global eth0
    inet6 fe80::2a0:24ff:fea6:57a0/10 scope link 
muscat# ip addr add dev eth0 local 10.255.255.12/24
muscat# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:a0:24:a6:57:a0 brd ff:ff:ff:ff:ff:ff
    inet 10.255.255.1/24 brd 10.255.255.255 scope global eth0
    inet 10.255.255.12/24 scope global secondary eth0
    inet6 fe80::2a0:24ff:fea6:57a0/10 scope link 

muscat# ifconfig eth0
eth0      Lien encap:Ethernet  HWaddr 00:A0:24:A6:57:A0  
          inet adr:10.255.255.1  Bcast:10.255.255.255  Masque:255.255.255.0
          adr inet6: fe80::2a0:24ff:fea6:57a0/10 Scope:Lien
  # <snip>
  # on remarque que ifconfig, lui, n'a rien compris...
 

traminer%ping 10.255.255.1
PING 10.255.255.1 (10.255.255.1): 56 octets data
64 octets from 10.255.255.1: icmp_seq=0 ttl=255 time=2.8 ms

--- 10.255.255.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 2.8/2.8/2.8 ms
traminer%ping 10.255.255.12
PING 10.255.255.12 (10.255.255.12): 56 octets data
64 octets from 10.255.255.12: icmp_seq=0 ttl=255 time=3.4 ms
64 octets from 10.255.255.12: icmp_seq=1 ttl=255 time=1.8 ms

--- 10.255.255.12 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 1.8/2.6/3.4 ms

(le coup de ssh sur 10.255.255.12 pour s'assurer que c'est bien la même machine
est laissé en exercice au lecteur...)

A++

-- 
Grumpf.



Reply to: