dynamically distribute gateway

3

Here is picture of very simplified network:

Linux is running on all of PCs. PC10 act like router = default gateway for net 1 and net2. Everywhere is IPv6 protocol. All PCs must have static IPv6 address.

And there is my issue. PC01-06 are static, but anybody can change PC10 for PC20. And PC20 has different IP addresses and that person has no permission to change that addresses. So default gateway for networks has different addresses.

Is there some tools for Linux, that can say something like "hey, I am new here, my ip address is XXXX and I am new default gateway." to other PCs in network. Or something like "i am new here and I have acces to this (other) network." and PCs will set their gateway address.

I know, there could be some static router, but in my case, there is no space for router. And the PC10 (or else) is not here all the time. There is only when net 1 and net 2 want to communicate with each other, so anybody connect PC10 (or else) to the both nets. On the other case there is no PC/router and they are separate networks.

(PCs are mini pcs, like raspberry pi)

One of my possible solution is, PCs have first DHCP address with gateway and second (my) static address. (yet untested)

Because network is very specific solution, there can not be added other devices and IP addresses must be static. I would like to know, is there some tools for Linux.

2ndChosenOne

Posted 2016-03-24T12:26:23.373

Reputation: 33

Answers

1

With IPv6 this is actually part of the protocol. Devices acting as routers can send router advertisements that tell other devices that they are a default gateway or a gateway for specific prefixes. Auto configuration on pc's 1-6 can then use that.

Look at radvd, it is usually included in your Linux distribution.

Sander Steffann

Posted 2016-03-24T12:26:23.373

Reputation: 4 169