@@ -25,22 +25,6 @@ func SetupLink(ifName, cidr string) error {
25
25
return exec .Command ("netsh" , "interface" , "ipv4" , "set" , "address" , ifName , "static" , ip .String (), addrMask ).Run ()
26
26
}
27
27
28
- func AddRoute (ifName string , to * net.IPNet , via net.IP ) error {
29
- if via .To4 () == nil { // ipv6
30
- return exec .Command ("netsh" , "interface" , "ipv6" , "add" , "route" , to .String (), ifName , via .String ()).Run ()
31
- }
32
- // ipv4
33
- addrMask := fmt .Sprintf ("%d.%d.%d.%d" , to .Mask [0 ], to .Mask [1 ], to .Mask [2 ], to .Mask [3 ])
34
- return exec .Command ("route" , "add" , to .IP .String (), "mask" , addrMask , via .String ()).Run ()
35
- }
36
-
37
- func DelRoute (ifName string , to * net.IPNet , via net.IP ) error {
38
- if via .To4 () == nil { // ipv6
39
- return exec .Command ("netsh" , "interface" , "ipv6" , "delete" , "route" , to .String (), ifName , via .String ()).Run ()
40
- }
41
- return exec .Command ("route" , "delete" , to .IP .String ()).Run ()
42
- }
43
-
44
28
func LinkByIndex (index int ) (* Link , error ) {
45
29
luid , err := winipcfg .LUIDFromIndex (uint32 (index ))
46
30
if err != nil {
0 commit comments