-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
42 lines (38 loc) · 871 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"flag"
"os"
"github.com/urfave/cli/v2"
)
var (
lanIf = flag.String("lan-interface", "eth0", "name of the LAN interface")
wanIf = flag.String("wan-interface", "eth1", "name of the WAN interface")
)
func main() {
app := &cli.App{
Name: "natlab",
Usage: "Testbed for NAT traversal software",
Commands: []*cli.Command{
{
Name: "nat",
Usage: "hook into kernel datapath and operate as a NAT box",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "lan-interface",
Aliases: []string{"L"},
Required: true,
Usage: "name of the LAN-side network interface",
},
&cli.StringFlag{
Name: "wan-interface",
Aliases: []string{"W"},
Required: true,
Usage: "name of the WAN-side network interface",
},
},
Action: nat,
},
},
}
app.Run(os.Args)
}