On Mon, May 28, 2018 at 02:35:41PM +0530, Akshat Kakkar wrote: > I am having a bridge named br0 having ports eno1 and eno2 as members. > I have given IP to br0 as 10.10.10.1/24 > > Now I want to create alias on br0 as br0:1 and give IP as > 10.10.10.2/24, but I am unable to. > > I know, we can add multiple IPs to br0 using "ip addr" command, but I > dont want to do it that way as I want all outgoing connections from > br0 to take src ip as 10.10.10.1. I know by providing option of "src" > in all routes, things can work but this looks more like a hack and > less of a solution.
I don't understand. There are no actual aliases since kernel 2.2 and an attempt to add "br0:1 with address 10.10.10.2/24" using ifconfig should result in the same configuration as ip addr add 10.10.10.2/24 brd + label br0:1 dev br0 where the "label br0:1" part only adds a label which allows ifconfig to see the new address. As both addresses share the same range, you don't even have to worry about source address as primary address (10.10.10.1 - or first one added in general) will be used unless specified otherwise. Michal Kubecek