pkg/netutil/isolate_linux.go
func DropPort(port int) error {
	cmdStr := fmt.Sprintf("sudo iptables -A OUTPUT -p tcp --destination-port %d -j DROP", port)
	if _, err := exec.Command("/bin/sh", "-c", cmdStr).Output(); err != nil {
		return err
	}
	cmdStr = fmt.Sprintf("sudo iptables -A INPUT -p tcp --destination-port %d -j DROP", port)
	_, err := exec.Command("/bin/sh", "-c", cmdStr).Output()
	return err
}
func DropPort(port int) error {
	cmdStr := fmt.Sprintf("sudo iptables -A OUTPUT -p tcp --destination-port %d -j DROP", port)
	if _, err := exec.Command("/bin/sh", "-c", cmdStr).Output(); err != nil {
		return err
	}
	cmdStr = fmt.Sprintf("sudo iptables -A INPUT -p tcp --destination-port %d -j DROP", port)
	_, err := exec.Command("/bin/sh", "-c", cmdStr).Output()
	return err
}
func DropPort ( port int ) error { cmdStr := fmt . Sprintf ( " " , port ) if _ , err := exec . Command ( " " , " " , cmdStr ) . Output ( ) ; err != nil { return err } cmdStr = fmt . Sprintf ( " " , port ) _ , err := exec . Command ( " " , " " , cmdStr ) . Output ( ) return err }
// DropPort drops all tcp packets that are received from the given port and sent to the given port.
DropPort drops all tcp packets that are received from the given port and sent to the given port .