question about configuring multiple interfaces on a host within the same ipv6 sub-net

Issues related to configuring your network
Post Reply
huiwang7436
Posts: 2
Joined: 2021/07/24 23:36:19

question about configuring multiple interfaces on a host within the same ipv6 sub-net

Post by huiwang7436 » 2021/07/24 23:38:42

Hi All

I have an host (running centos8), it has multiple interfaces connecting to the same IPv6 sub-net. Different IPv6 addresses are statically assigned to these interfaces. All these interfaces are assigned with the same gateway address.

I'd like to config the routing policy so that:

All packets with source IP address specified goes out via the interface where the source IP address was assigned to.
When source IP address is not specified by application. (ex. connect() without binding to an IP address), different interfaces' IP address is picked (as source IP address) randomly (if the destination IP address is different).

How do I config routing policy to achieve these in such an environment.

Please let me know if there are more appropriate mail lists for my question.

Thanks,

Hui

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: question about configuring multiple interfaces on a host within the same ipv6 sub-net

Post by jlehtone » 2021/07/26 11:22:49

The closest to that is probably policy-based routing. See https://access.redhat.com/documentation ... networking

huiwang7436 wrote:
2021/07/24 23:38:42
I have an host (running centos8), it has multiple interfaces connecting to the same IPv6 sub-net.

All these interfaces are assigned with the same gateway address.
Note that interfaces/connections do not have a gateway. Subnet has routers. A router is the gateway to another subnet.
The default route of a machine (aka "gateway") tell which machine in the link-local subnet, which neighbour, can relay traffic to other subnets.

Furthermore, a single interface can have multiple IP addresses; one does not need multiple interfaces for that.
In fact, IPv6 has that by default. There is always link-local address and then the official public address. Optionally there might be site-local address, and multiple temporary public addresses from the same prefix as the primary address. For example, Windows seems to preferably use the latter for obfuscation.

huiwang7436
Posts: 2
Joined: 2021/07/24 23:36:19

Re: question about configuring multiple interfaces on a host within the same ipv6 sub-net

Post by huiwang7436 » 2021/07/26 16:49:46

Thanks jlehtone for the reply, I am configuring one global ip address / interface for the internal network i have.
Regarding policy based routing:
It seems I can use ip -6 rule to define different routing tables for different source ip address (associated with my interfaces). And use ip -6 route to add subnet local and default routing rule in these routing tables.
The examples given in https://access.redhat.com/documentation ... networking are all ipv4 based, is ipv6 configuration any different?
Is it ok to avoid creating new tables (for different source ip addresses) and just use ip -6 route add from <source ip address> dest via... to create the routing policy?
Also how do i config my routing policy so the outing interface will change when i connect to different remote servers? (connect without binding to specific local ip address)
Thanks,
Hui

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: question about configuring multiple interfaces on a host within the same ipv6 sub-net

Post by jlehtone » 2021/07/26 19:14:18

There is no ip route add from ...; that is what rules are for.

I've never done policy routing for IPv6.

Post Reply