Skip to content

Commit

Permalink
disable setting up squid on proxy node
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Apr 25, 2024
1 parent 8f02ff1 commit a58f725
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions e2e/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,32 +289,32 @@ func CreateProxy(in *Input) string {
func ConfigureProxy(in *Input) {
// starts by installing dependencies, setting up the second network interface ip
// address and configuring iptables to allow dns requests forwarding (nat).
proxyName := fmt.Sprintf("node-%s-proxy", in.id)
for _, cmd := range [][]string{
{"apt-get", "update", "-y"},
{"apt-get", "install", "-y", "iptables", "squid"},
{"ip", "addr", "add", "10.0.0.254/24", "dev", "eth1"},
{"ip", "link", "set", "eth1", "up"},
{"sysctl", "-w", "net.ipv4.ip_forward=1"},
{"iptables", "-t", "nat", "-o", "eth0", "-A", "POSTROUTING", "-p", "udp", "--dport", "53", "-j", "MASQUERADE"},
} {
RunCommandOnNode(in, cmd, proxyName)
}

// create a simple squid configuration that allows for localnet access. upload it
// to the proxy in the right location. restart squid to apply the configuration.
tmpfile, err := os.CreateTemp("", "squid-config-*.conf")
if err != nil {
in.T.Fatalf("Failed to create temp file: %v", err)
}
defer os.Remove(tmpfile.Name())
if _, err = tmpfile.WriteString("http_access allow localnet\n"); err != nil {
in.T.Fatalf("Failed to write to temp file: %v", err)
}
file := File{SourcePath: tmpfile.Name(), DestPath: "/etc/squid/conf.d/ec.conf", Mode: 0644}
tmpfile.Close()
CopyFileToNode(in, proxyName, file)
RunCommandOnNode(in, []string{"systemctl", "restart", "squid"}, proxyName)
//proxyName := fmt.Sprintf("node-%s-proxy", in.id)
//for _, cmd := range [][]string{
// {"apt-get", "update", "-y"},
// {"apt-get", "install", "-y", "iptables", "squid"},
// {"ip", "addr", "add", "10.0.0.254/24", "dev", "eth1"},
// {"ip", "link", "set", "eth1", "up"},
// {"sysctl", "-w", "net.ipv4.ip_forward=1"},
// {"iptables", "-t", "nat", "-o", "eth0", "-A", "POSTROUTING", "-p", "udp", "--dport", "53", "-j", "MASQUERADE"},
//} {
// RunCommandOnNode(in, cmd, proxyName)
//}
//
//// create a simple squid configuration that allows for localnet access. upload it
//// to the proxy in the right location. restart squid to apply the configuration.
//tmpfile, err := os.CreateTemp("", "squid-config-*.conf")
//if err != nil {
// in.T.Fatalf("Failed to create temp file: %v", err)
//}
//defer os.Remove(tmpfile.Name())
//if _, err = tmpfile.WriteString("http_access allow localnet\n"); err != nil {
// in.T.Fatalf("Failed to write to temp file: %v", err)
//}
//file := File{SourcePath: tmpfile.Name(), DestPath: "/etc/squid/conf.d/ec.conf", Mode: 0644}
//tmpfile.Close()
//CopyFileToNode(in, proxyName, file)
//RunCommandOnNode(in, []string{"systemctl", "restart", "squid"}, proxyName)

// set the default route on all other nodes to point to the proxy we just created.
// this makes it easier to ensure no internet will work on them other than dns and
Expand Down

0 comments on commit a58f725

Please sign in to comment.