2

I configured static route using Vyatta like following:

set protocols static route 192.168.1.0/24 next-hop 10.100.0.204

But a packet which destination is 192.168.1.10 is not routed to 10.100.0.204.

vyatta@vyatta# traceroute 192.168.1.10
traceroute to 192.168.1.10 (192.168.1.10), 30 hops max, 60 byte packets
 1  * * *
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *^C
[edit]

It seems that the routing table is correct:

vyatta@vyatta# ip route
default via 10.0.1.1 dev eth0  proto zebra
10.0.1.0/24 dev eth0  proto kernel  scope link  src 10.0.1.5
10.100.0.101 dev pptp1  proto kernel  scope link  src 10.255.254.0
10.100.0.102 dev pptp3  proto kernel  scope link  src 10.255.254.0
10.100.0.200 dev pptp0  proto kernel  scope link  src 10.255.254.0
10.100.0.204 dev pptp2  proto kernel  scope link  src 10.255.254.0
127.0.0.0/8 dev lo  proto kernel  scope link  src 127.0.0.1
192.168.1.0/24 via 10.100.0.204 dev pptp2  proto zebra

Strangely, it works correctly if next-hop is set to 10.100.0.200:

vyatta@vyatta# traceroute 192.168.1.10 traceroute to 192.168.1.10 (192.168.1.10), 30 hops max, 60 byte packets 1 10.100.0.200 (10.100.0.200) 7.524 ms 7.368 ms 7.590 ms 2 * * * 3 * * * 4 * * * 5 * * * 6 * * * 7 *^C [edit]

Please tell me where I misconfigured.

Edit:

My network architecture is following:

enter image description here

I'm running Vagrant on Mac OS X machine(#1). Eventually I want to let Mac OS X(#3) access Vagrant VM(192.168.1.10) via VPN. The VPN connection is no problem.

Current Vyatta configuration

VPN:

vyatta@vyatta# show vpn
 pptp {
     remote-access {
         authentication {
             local-users {
                 ...
             }
             mode local
         }
         client-ip-pool {
             start 10.100.0.1
             stop 10.100.0.255
         }
         dns-servers {
             server-1 10.0.1.185
             server-2 10.0.1.162
         }
         outside-address 10.0.1.5
     }
 }
[edit]

Routing:

vyatta@vyatta# show protocols
 static {
     route 192.168.1.0/24 {
         next-hop 10.100.0.204 {
         }
     }
 }
[edit]

Vagrant VM Network Configuration

config.vm.network "public_network", ip: "192.168.1.10", netmask: "255.255.255.0", bridge: "en0: Ethernet"

Status

Vyatta
vyatta@vyatta# ip a
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 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether <MAC_ADDRESS> brd ff:ff:ff:ff:ff:ff
    inet 10.0.1.5/24 brd 10.0.1.255 scope global eth0
    inet6 ************* scope link
       valid_lft forever preferred_lft forever
837: pptp3: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 100
    link/ppp
    inet 10.255.254.0 peer 10.100.0.102/32 scope global pptp3
899: pptp1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 100
    link/ppp
    inet 10.255.254.0 peer 10.100.0.101/32 scope global pptp1
904: pptp2: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 100
    link/ppp
    inet 10.255.254.0 peer 10.100.0.204/32 scope global pptp2
907: pptp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 100
    link/ppp
    inet 10.255.254.0 peer 10.100.0.200/32 scope global pptp0
[edit]

It can reach to Mac hosts but can't reach to Vagrant VM.

Vagrant VM
[vagrant@vagrant-ubuntu-precise-64:~][2014-08-24T04:59:29]
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether <MAC_ADDRESS> brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
    inet6 ************ scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether <MAC_ADDRESS> brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global eth1
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
    link/ether <MAC_ADDRESS> brd ff:ff:ff:ff:ff:ff
    inet 172.17.42.1/16 scope global docker0

It can reach to every hosts:

[vagrant@vagrant-ubuntu-precise-64:~][2014-08-26T12:36:23]
$ ping 192.168.1.26
PING 192.168.1.26 (192.168.1.26) 56(84) bytes of data.
64 bytes from 192.168.1.26: icmp_req=1 ttl=64 time=0.473 ms
64 bytes from 192.168.1.26: icmp_req=2 ttl=64 time=0.314 ms
^C
--- 192.168.1.26 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.314/0.393/0.473/0.081 ms

[vagrant@vagrant-ubuntu-precise-64:~][2014-08-26T12:36:36]
$ ping 192.168.1.30
PING 192.168.1.30 (192.168.1.30) 56(84) bytes of data.
64 bytes from 192.168.1.30: icmp_req=1 ttl=64 time=1.51 ms
64 bytes from 192.168.1.30: icmp_req=2 ttl=64 time=0.652 ms
^C
--- 192.168.1.30 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1003ms
rtt min/avg/max/mdev = 0.652/1.084/1.516/0.432 ms

[vagrant@vagrant-ubuntu-precise-64:~][2014-08-26T12:36:38]
$ ping 10.255.254.0
PING 10.255.254.0 (10.255.254.0) 56(84) bytes of data.
64 bytes from 10.255.254.0: icmp_req=1 ttl=63 time=7.24 ms
^C
--- 10.255.254.0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.245/7.245/7.245/0.000 ms

[vagrant@vagrant-ubuntu-precise-64:~][2014-08-26T12:37:59]
$ ping 10.100.0.200
PING 10.100.0.200 (10.100.0.200) 56(84) bytes of data.
64 bytes from 10.100.0.200: icmp_req=1 ttl=63 time=13.3 ms
^C
--- 10.100.0.200 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 13.366/13.366/13.366/0.000 ms
Mac OS X (#1)

Routing Table:

$ netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            192.168.1.1        UGSc           10        0     en0
default            192.168.1.1        UGScI           0        0     en1
default            10.255.254.0       UGScI           0        0    ppp0
10                 ppp0               USc             1        6    ppp0
10.255.254.0       10.100.0.204       UHr             1       76    ppp0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              6   391932     lo0
169.254            link#4             UCS             0        0     en0
192.168.1          link#4             UCS             4        0     en0
192.168.1          link#5             UCSI            2        0     en1
192.168.1.1        <MAC_ADDRESS>      UHLWIir        13   267249     en0   1200
192.168.1.1        <MAC_ADDRESS>      UHLWIir         1        4     en1    605
192.168.1.10       <MAC_ADDRESS>      UHLWI           0        2     en0    507
192.168.1.26       127.0.0.1          UHS             0        0     lo0
192.168.1.28       127.0.0.1          UHS             0        3     lo0
192.168.1.30       <MAC_ADDRESS>      UHLWIi          2     2027     en0   1200
192.168.1.255      ff:ff:ff:ff:ff:ff  UHLWbI          0       94     en0
192.168.2          link#11            UC              2        0 vboxnet
192.168.2.255      ff:ff:ff:ff:ff:ff  UHLWbI          0        9 vboxnet
192.168.33         link#10            UC              2        0 vboxnet
192.168.33.255     ff:ff:ff:ff:ff:ff  UHLWbI          0        9 vboxnet
192.168.59         link#13            UC              2        0 vboxnet
192.168.59.255     ff:ff:ff:ff:ff:ff  UHLWbI          0        9 vboxnet
Mac OS X (#2)

Routing Table:

$ netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            192.168.1.1        UGSc           67        0     en0
default            link#5             UCSI            0        0     en1
default            link#10            UCSI            0        0 bridge1
default            10.255.254.0       UGScI           0        0    ppp0
10                 ppp0               USc             3        0    ppp0
10.255.254.0       10.100.0.200       UHr             1        4    ppp0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              5     1238     lo0
169.254            link#4             UCS             1        0     en0
169.254.78.173     127.0.0.1          UHS             1        0     lo0
169.254.255.255    link#4             UHRLSW          0      759     en0      5
192.168.1          link#4             UCS             4        0     en0
192.168.1.1        <MAC_ADDRESS>      UHLWIir        69     8091     en0   1192
192.168.1.10       <MAC_ADDRESS>      UHLWI           0        2     en0    917
192.168.1.26       <MAC_ADDRESS>      UHLWIi          1     1829     en0   1185
192.168.1.30       127.0.0.1          UHS             0        1     lo0
192.168.1.255      ff:ff:ff:ff:ff:ff  UHLWbI          0       25     en0
  • We need more information to help. What is at 10.100.0.204? What is at 10.100.0.200? Do you have access to either of those devices? Where is 192.168.1.0 connected? – Ron Trunk Aug 24 '14 at 11:32
  • Keep in mind with that static route after the lookup to forward the traffic the router must find the Interface to physically forward the traffic. If the router cannot find which link has that next hop 10.100.0.204. it will not be able to forward the traffic. Please make sure you can ping that next hop and see the mac address in the arp cache. Edit: didnt notice the output, 10.100.0.204 via pptp2. Make sure the other end of that tunnel is up & pingable – LucentMoon Aug 24 '14 at 14:22
  • Sorry for my poor description. Added configuration detail and current status. Vyatta can ping to every physical nodes. – Takuya Matsuyama Aug 26 '14 at 0:55
  • Where does the Default Gateway of the Vagrant VM point to? Please also ping the 10.100.0.204 and 10.100.0.200 from the VM and check if you get an ARP resolution (arp -a). – Thieron Aug 27 '14 at 12:29
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 10 '17 at 15:00
-1
set protocols static route 192.168.1.0/24 next-hop 10.100.0.204 distance 1
  • 2
    Can you please add an explanation why this is the solution? – Teun Vink Mar 28 '16 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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