Multiple IP on interface


#1

I would like to setup multiple IP’s on the same interface.
i.e.
eth0 192.168.0.10
eth0:0 192.168.0.11

I searched, found and reviewed a thread for a similar question, but it did not address my issue.

In that thread they recommended:

set interfaces ethernet eth0 address 198.99.192.164/32 set interfaces ethernet eth0 vif 0 address 198.99.192.165/32

When I tried this I got an error on commit

[code][ interfaces ethernet eth0 vif 0 ]
RTNETLINK answers: Operation not permitted
Error creating VLAN device eth0.0

[[interfaces ethernet eth0 vif 0]] failed
Commit failed[/code]

When looking at the error message and command expansion options it seems that the example above was for defining a vlan interface instead of just a virtual network interface.

So, is there a way to create a virtual network interface?

Thanks


#2

you can add multiple IPs to an interface (aliases)

set interfaces ethernet eth0 address 198.99.192.164/32
set interfaces ethernet eth0 address 198.99.192.165/32
set interfaces ethernet eth0 address 198.99.192.166/32
etc.


#3

That seems to work. thanks


#4

In fact, my interface is connected to a trunk port on switch and I have no issue in configuration a VIF

ethernet eth0 {
         duplex auto
         hw-id 00:50:56:be:5d:cb
         smp_affinity auto
         speed auto
         vif 101 {
             address 10.16.101.2/24
         }
         vif 252 {
             address 10.252.16.3/24
         }
     }