Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added diverter option to ziti tunnel #2387

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ziti/tunnel/tproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package tunnel

import (
"fmt"

"github.com/openziti/ziti/tunnel/intercept/tproxy"
"github.com/spf13/cobra"
)
Expand All @@ -38,6 +39,7 @@ func NewTProxyCmd() *cobra.Command {
PostRun: rootPostRun,
}
runTProxyCmd.PersistentFlags().String("lanIf", "", "if specified, INPUT rules for intercepted service addresses are assigned to this interface ")
runTProxyCmd.PersistentFlags().String("diverter", "", "if specified, use external tproxy configuration utility instead of internal iptables implementation")
return runTProxyCmd
}

Expand All @@ -47,8 +49,12 @@ func runTProxy(cmd *cobra.Command, _ []string) error {
if err != nil {
return err
}
diverter, err := cmd.Flags().GetString("diverter")
if err != nil {
return err
}

interceptor, err = tproxy.New(tproxy.Config{LanIf: lanIf})
interceptor, err = tproxy.New(tproxy.Config{LanIf: lanIf, Diverter: diverter})
if err != nil {
return fmt.Errorf("failed to initialize tproxy interceptor: %v", err)
}
Expand Down
Loading