Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following configuration:

  • Linux machine with ip
  • bridge over a virtual interface with ip
  • linux in a lxc container over the bridge with ip
  • vpn on the container with ip
  • the machines behind the vpn are in the network

I want to reach from the Linux machine the ips from the vpn

Why I tried: ip route add via dev bridge_lxc

ping/ssh works to

Tried to route the vpn network through ip route add via dev bridge_lxc RTNETLINK answers: Network is unreachable

how can I route all the vpn network through the virtual machine inside the container?

share|improve this question
So it looks like I need to do this: ip route add via dev bridge_lxc onlink – cristi Jan 15 '13 at 10:33

1 Answer 1

The error message indicates that the host you are trying to add this route on doesn't know where is. You will need to provide that route first.

In general: if you want the 172.x.x.x network range to be accessible from the 10.x.x.x network, you will somehow need to let the computers in the 10.x.x.x network know that your host is the router for the 172.x.x.x range.

You will also need to set up adequate routing on the host machine for that range:

ip route add 172.x.x.x/xx via

If you have a split-horizon VPN, you will also need to advertise the 10.x.x.x network ranges (and possibly the 192.x.x.x ranges) to your VPN clients.

In order to debug your network routing, I suggest you get acquainted with the ip route get command. It displays you which interface a target address is seen through. Remember, routing needs to work both ways. The return packets must find their way back.

share|improve this answer
For me it worked after doing: ip route add via dev bridge_lxc onlink. I don't have access to the machine anymore in order to test your sugestion – cristi May 15 '13 at 16:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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