A
A
Alexander Globov2014-12-23 09:49:24
linux
Alexander Globov, 2014-12-23 09:49:24

How to set up routing on the server for two blocks of ip addresses?

Hello.
There is a server on Debian 7 on which the web server, telephony and so on are spinning. Previously, we bought a block for 8 ip-addresses 2.135.246.120-2.135.246.127. Over time, they began to be missed, they took another block of 32 addresses 2.135.246.192-2.135.246.223.
ifconfig
61e4310285.png
Trying to add a new interface

ifconfig eth0:2 2.135.246.194 netmask 255.255.255.224 up

the address is not pinged. Decided that there might be a problem with the gateway.
d7f114b9ef.png
I understand that he is trying to climb the gateway for the first set of addresses 2.135.246.121. Tried to set gateway
ip route change 2.135.246.192/27 via 2.135.246.193 dev eth0

did not help.
Tried like this
ip route change 2.135.246.192/27 via 2.135.246.193 dev eth0 src 2.135.246.194

The answer came out: RTNETLINK answers: No such process
340ddda57c.png
I myself got into system administrators by accident, I'm just starting, I really hope for your help. Tell me how to set up the 2nd block of addresses.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konkase, 2014-12-23
@sanekglobov

You should configure ip rule and route lists to them. That is, something like this: If the packet arrives at the address from network 1, then the gateway will be 1, and if it arrives at the address from network 2, then the gateway = 2.
(man ip rule, man ip route)
Another option is BGP with your operator.

A
Archie Kuznetsov, 2014-12-23
@Wolf4ara

Good day!
Well, firstly, for different networks with different IPs it is better to create separate routing tables:
[[email protected] ~]$ ip rule
0: from all lookup local
32763: from 10.10.100.12 lookup gate100
32764: from 10.10.50.12 lookup gate2
32765: from all to 10.10.10.30 lookup shared_db
32766: from all lookup main
32767: from all lookup default
where each table will have its own gate:
[[email protected] ~]$ ip route show table gate2
default via 10.10.50.1 dev eth0
[[email protected] ~]$ ip r
default via 10.10.10.1 dev bond0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question