[GLLUG] Adding multiple addresses to multiple interfaces
Chris Bell
chrisbell at chrisbell.org.uk
Wed Jan 3 12:33:03 UTC 2018
On Tuesday, 2 January 2018 21:36:13 GMT Andy Smith via GLLUG wrote:
> If you have a sequence of "ip" commands that do what you want then at
> the very least you should be able to call them like so:
>
> allow-hotplug enp2s2
> iface enp2s2 inet static
> hwaddress 00:80:c8:f7:86:b3
> address 172.21.1.22
> netmask 255.255.255.0
>
> iface enp2s2 inet6 static
> address 2002:51ae:faaf:20:280:c8ff:fef7:86b3/64
> hwaddress 00:80:c8:f7:86:b3
> up ip address add
> fd39:7761:9509:7f:280:c8ff:fef7:86b3/64 dev $IFACE scope site
>
> i.e. do everything extra that you need to in the "up" script, with the "ip"
> command.
>
> …although I can't see why that should be necessary.
>
> Cheers,
> Andy
Thanks for the suggestion, I modified /etc/network/interfaces as suggested but
after a re-boot the result was the same as before, with enp2s1 correctly auto-
configured, IPv4 only plus the IPv6 link address configured for enp2s2 and
enp2s3, and enp2s4 with IPv4 and two complete IPv6 addresses but both marked
as scope global.
The /etc/shorewall6/interfaces file is configured with the nets= information,
and systemctl status shorewall6 reports all OK.
While I was trying to get Jessie to work I spent some time logging the
interface MAC order after a re-start to find the optimum physical locations of
the ethernet cards, but the result was inconsistent for all, although they are
now located in the most likely slots.
I might try to set up another box with four ethernet sockets but just the
basic Debian Stretch to see what happens, then gradually install software to
test whether it breaks.
--
Chris Bell
Website http://chrisbell.org.uk
More information about the GLLUG
mailing list