Hello, On Sat, May 23, 2020 at 09:07:01AM +0100, Chris Bell via GLLUG wrote: > with the correct prefix used for sending and receiving.
In case it helps, I am often in the situation where a host has a general purpose v6 address and several "service addresses" that are only used as listening addresses for different services on the host. I don't like outgoing packets to source from one of those service addresses, but the default Linux behaviour is to use the last added address on the interface as a source address. There are two easy ways to influence this. One way is to add the desired source address with a longer prefix, e.g. /128. If all others are shorter prefix than this, e.g. /64s then the /128 will be preferred. The way I like better is to add the service addresses with a preferred_lft of 0 like: # ip addr add 2001:db8::1/64 dev $IFACE preferred_lft 0 That would then show up as "deprecated" in the "ip -6 addr" list, which prevents it being used for any source address nut doesn't interfere with it receiving packets addressed to it. Cheers, Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting -- GLLUG mailing list [email protected] https://mailman.lug.org.uk/mailman/listinfo/gllug
