Answer the question
In order to leave comments, you need to log in
How to route the second subnet?
Hello colleagues.
There is a gateway under Gentoo in the network 192.168.1.1
But the problem is that 255 subnet addresses are not enough.
How to make subnet routing 192.168.1.1 and new 192.168.2.1
On the gateway did:
# Route to 192.168.1.0/24
iptables -A POSTROUTING -t nat --dst 192.168.1.0/255.255.255.0 -j SNAT --to-source 192.168.1.1
# Route to 192.168.2.0/24
iptables -A POSTROUTING -t nat --dst 192.168.2.0/255.255.255.0 -j SNAT --to-source 192.168.2.1
Answer the question
In order to leave comments, you need to log in
And just add a bit to the mask in any way? Why build a separate network, and even with NAT?
Register the second address from the new subnet on the interface, check that there are no blocking policies for incoming traffic.
Indeed, why bother with routing, if you can just change the mask on all computers and that's it. Instead of 255.255.255.0, make 255.255.252.0 on all computers and you have an ip range from 192.168.0.0 to 192.168.3.0 at your disposal.
Set IP addresses for new computers from this range and they will be on the same network.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question