RE: Configuring multiple IP addresses on VLAN interface using ifupdown
Hi,
>>>> allow-auto eth0.9
>>>> iface eth0.9 inet static
>>>> address 192.168.1.119
>>>> netmask 255.255.255.0
>>>> gateway 192.168.1.1
>>>> post-up ip address add 192.168.1.199/24 dev eth0.9
>>
>> What I use is:
>> -=-=-=-=-=-
>> auto eth0
>> iface eth0 inet static
>> address 172.16.17.1
>> netmask 255.255.255.0
>>
>> auto vlan100
>> iface vlan100 inet static
>> vlan-raw-device eth0
>> address 192.168.178.10
>> netmask 255.255.255.0
>> gateway 192.168.178.1
>> -=-=-=-=-=-
>
> This is just one address: Steffen was looking for a multiple-address method.
For that I use the "post-up ip address add ..." lines too.
On an external gateway I have multiple lines like that to get all the ip-numbers up for which that interface handles the incoming data.
However, if he wants A LOT of extra addresses that might change too, maybe some script that runs after the interface is up would be better. That way the script could use a database in whatever form to handle that.
Then he could use just a post-up /etc/network/lots-of-addresses.sh start and a pre-down /etc/network/lots-of-addresses.sh stop line in the interfaces file.
If each address is to have its own vlan then it is still doable but a bit more complex. I have never done it that way, I have had only a few different vlans that I was able to declare in the interfaces file.
Bonno Bloksma
Reply to: