Answer the question
In order to leave comments, you need to log in
How to add IP address to iproute2 table from IP block?
Good afternoon. Can you please tell me why I cannot add an IP address to the iproute2 table from the IP block?
There is a block of four IP addresses: xxx.xxx.xxx.60-xxx.xxx.xxx.63. I enter the first four addresses in the table without problems:
ip route add xxx.xxx.xxx.60 dev ens20 scope link src xxx.xxx.xxx.60 table wan-60
ip route add xxx.xxx.xxx.61 dev ens21 scope link src xxx.xxx.xxx.61 table wan -61
ip route add xxx.xxx.xxx.62 dev ens22 scope link src xxx.xxx.xxx.62 table wan-62
Here's the last one, I get:
ip route add xxx.xxx.xxx.63 dev ens23 scope link src xxx.xxx.xxx.63 table wan-63
Error: Invalid prefsrc address.
Answer the question
In order to leave comments, you need to log in
Judging by your phrase "That is, in fact, the gateway is xxx.xxx.xxx.252" you do not understand what a subnet mask is.
You have a subnet of 4 addresses (just the same mask 255.255.255.252), of which two are available to you - the second and third.
The first address is the network ID.
The last address on the subnet is the reserved address for broadcasts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question