I have the following problem. First of all. Here are my interfaces.

# ip addr
ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever

2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth1
    inet6 fe80::a00:27ff:fe28:b0c4/64 scope link
       valid_lft forever preferred_lft forever

As you can see the loopback interface serves following network, the network mask is

My problem is that I need to route all traffic for example for the network to the interface eth1.

I have following routes now

default via dev eth1
default via dev eth1  metric 203 dev eth1  scope link dev eth1  proto kernel  scope link  src  metric 203 dev eth1  scope link

And I try to add the following route

ip route add via dev eth1

But unfortunately it doesn't work.

Here is the output

root@sys:/ # ip route flush cache
ip route flush cache
root@sys:/ # ip route get ""
ip route get ""
local dev lo  src
    cache <local>

As you can see all packets are still redirected to loopback.

What is the best solution for that problem ?

closed as off-topic by Tero Kilkanen, Jenny D, Paul Haldane, yagmoth555, 030 May 16 '17 at 10:29

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Tero Kilkanen, Jenny D, Paul Haldane, yagmoth555, 030
If this question can be reworded to fit the rules in the help center, please edit the question.


As mentioned in What is the rest of the address space used for? , the block is the loopback block, and all packets destined to the block must be looped back to the origin host.

So, you cannot route those packets anywhere.

  • Thanks for the answer, there is no really way to fix this somehow ? Kernel module, iptables, somehow, I really need it. – e109848 May 5 '17 at 12:18
  • 1
    I think you actual problem is something different and you are hunting a XY problem. Why do you need to route Any service or machine you want to reach? – Thomas May 5 '17 at 12:31
  • @Thomas , the problem that there is no way to change, third party software forces to use it, and on windows it works fine. – e109848 May 5 '17 at 14:10
  • 2
    You might be able to change kernel behavior by building your own custom version of the kernel that changes how the lo interface works. However, you really need to know what you are doing to make this happen. Your 3rd party software is something very weird when it is doing things like that. – Tero Kilkanen May 5 '17 at 14:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.