centerclick / feedback

Issues, Bug Reports, and Feature Requests
7 stars 0 forks source link

Provide option to configure static routes #53

Closed NormHenderson closed 2 years ago

NormHenderson commented 2 years ago

Except in a simple star network static routes are needed rather than only a single gateway. Consider:

                                                                                              /---192.168.1.1xx [clients X]
[Public Internet upstream] 99.99.99.1 ----------- 99.99.99.50 [eth0 router X eth1] 192.168.1.1 -----*A*---- 192.168.1.254 [router Y eth0]
                                                                    [clients Y] 192.168.2.1xx ------------- 192.168.2.1   [router Y eth1] 

If the NTP-250 is switched in at point A, with gateway 192.168.1.254 it can reply to requests from [clients X] and [clients Y] but it cannot reach the Internet. If it has gateway 192.168.1.1 it can reach the Internet, but cannot reply to [clients Y] on 192.168.2.x.

There is a workaround. [Router Y[ could SNAT all NTP requests coming from [clients Y] so they appear to be coming from 192.168.1.254 and in that case the NTP-250 replies to 192.168.1.254, which is passed back to the client by [Router Y]. However this adds overhead and delay which is particularly undesirable for precision timekeeping.

A simple syntax could be within conf network : ip4 route destination-IP/mask gateway-IP
e.g. ip4 route 192.168.2.0/24 192.168.1.254

An even better alternative would be to allow general Linux commands to the NTP-250 CLI: exec arbitrary-linux-command-string e.g. exec ip route add 192.168.2.0/24 metric 100 nexthop via 192.168.1.254

dave4445 commented 2 years ago

should be doable

dave4445 commented 2 years ago

will be in 1.44:

NTP200[net]> ip4 route 192.168.1.0/24 192.168.66.170
Add IPv4 Static Route?
  IP/MASK: 192.168.1.0/24
  NH:      192.168.66.170
Add? [y/n] y

Adding IPv4 Static Route.
Connection successfully reapplied to device 'eth0'.
Waiting...

Current Settings:
Status:        good
Link:          link-up
MAC Addr:      xx:xx:xx:xx:xx:xx
Addressing:    IPv4: auto, IPv6: auto
IPv4 Addr:     192.168.66.167/28
IPv4 GW:       192.168.66.161
IPv4 Routes:   192.168.1.0/24 nh 192.168.66.170
IPv6 Addr:     2001:db8:11:22:cbaf:f3bf:6da6:3a34/64, 2001:db8:11:22::8:b4
IPv6 GW:       fe80::1061
DNS:           192.168.66.1, 192.168.66.146, 2001:db8:22::1, 2001:db8:22:1060::0
LLDP Neighbor: mac xx:xx:xx:xx:xx:xx, office2-sw1, local 5

Network Commands:
  exit                                   Exit Network Menu
  ip4 auto                               IPv4 DHCP
  ip4 static IP/MASK GW { DNS1,DNS2 }    IPv4 Static (DNS optional)
  ip4 route IP/MASK NH                   Add IPv4 Static Route
  no ip4 route IP/MASK NH                Remove IPv4 Static Route
  ip6 auto                               IPv6 Autoconf/DHCP
  ip6 static IP/MASK GW { DNS1,DNS2 }    IPv6 Static (DNS optional)
  ip6 route IP/MASK NH                   Add IPv6 Static Route
  no ip6 route IP/MASK NH                Remove IPv6 Static Route

Examples:
  ip4 static 203.0.113.53/24 203.0.113.1 198.51.100.49,192.0.2.220
  ip6 static 2001:db8:74::10/64 2001:db8:74::1 2001:db8::59,2001:db8::32
  ip4 route 192.0.2.0/24 203.0.113.1
  ip6 route 2001:db8:114::/48 2001:db8:74::222

NTP200[net]> 
NormHenderson commented 2 years ago

Excellent, thank you! I can beta if helpful.

dave4445 commented 2 years ago

1.44 released