ip from iproute2 replaces the legacy route tool which is often not
installed by default on recent Linux distributions.
The same patch has been done in network.go and is re-used here.
| ... | ... |
@@ -17,8 +17,7 @@ func setupNetworking(gw string) {
|
| 17 | 17 |
if gw == "" {
|
| 18 | 18 |
return |
| 19 | 19 |
} |
| 20 |
- cmd := exec.Command("/sbin/route", "add", "default", "gw", gw)
|
|
| 21 |
- if err := cmd.Run(); err != nil {
|
|
| 20 |
+ if _, err := ip("route", "add", "default", "via", gw); err != nil {
|
|
| 22 | 21 |
log.Fatalf("Unable to set up networking: %v", err)
|
| 23 | 22 |
} |
| 24 | 23 |
} |