How Do I Add a Route?
After creating a Selectel global router (formerly L3VPN), the client needs to configure routing between network segments by registering routes to each segment of the used network through new gateway addresses.
For such a network:
- Segment machines must be connected to the dedicated networks.
- IP addresses on the interfaces must be configured.
- Segment 1 requires a route to network a.a.a.a via GW (b.b.b.254).
- Segment 2 requires a route to network b.b.b.b via GW (a.a.a.254).
For Windows
route -p ADD a.a.a.a MASK 255.255.255.0 b.b.b.254 METRIC 1
, where:
- route is a program for working with routes;
- ADD is a command to add a route;
- -p key is needed to save the route;
- MASK is a network mask;
- METRIC 1 is a parameter defining the priority of the above gateway, where 1 is the highest priority.
You can check the added routes using the route print
command.
For Linux
route add -net a.a.a.a netmask 255.255.255.0 gateway eth0
For CentOS
route add -net a.a.a.a/24 gw b.b.b.254