@@ -289,32 +289,32 @@ func CreateProxy(in *Input) string {
289
289
func ConfigureProxy (in * Input ) {
290
290
// starts by installing dependencies, setting up the second network interface ip
291
291
// address and configuring iptables to allow dns requests forwarding (nat).
292
- proxyName := fmt .Sprintf ("node-%s-proxy" , in .id )
293
- for _ , cmd := range [][]string {
294
- {"apt-get" , "update" , "-y" },
295
- {"apt-get" , "install" , "-y" , "iptables" , "squid" },
296
- {"ip" , "addr" , "add" , "10.0.0.254/24" , "dev" , "eth1" },
297
- {"ip" , "link" , "set" , "eth1" , "up" },
298
- {"sysctl" , "-w" , "net.ipv4.ip_forward=1" },
299
- {"iptables" , "-t" , "nat" , "-o" , "eth0" , "-A" , "POSTROUTING" , "-p" , "udp" , "--dport" , "53" , "-j" , "MASQUERADE" },
300
- } {
301
- RunCommandOnNode (in , cmd , proxyName )
302
- }
303
-
304
- // create a simple squid configuration that allows for localnet access. upload it
305
- // to the proxy in the right location. restart squid to apply the configuration.
306
- tmpfile , err := os .CreateTemp ("" , "squid-config-*.conf" )
307
- if err != nil {
308
- in .T .Fatalf ("Failed to create temp file: %v" , err )
309
- }
310
- defer os .Remove (tmpfile .Name ())
311
- if _ , err = tmpfile .WriteString ("http_access allow localnet\n " ); err != nil {
312
- in .T .Fatalf ("Failed to write to temp file: %v" , err )
313
- }
314
- file := File {SourcePath : tmpfile .Name (), DestPath : "/etc/squid/conf.d/ec.conf" , Mode : 0644 }
315
- tmpfile .Close ()
316
- CopyFileToNode (in , proxyName , file )
317
- RunCommandOnNode (in , []string {"systemctl" , "restart" , "squid" }, proxyName )
292
+ // proxyName := fmt.Sprintf("node-%s-proxy", in.id)
293
+ // for _, cmd := range [][]string{
294
+ // {"apt-get", "update", "-y"},
295
+ // {"apt-get", "install", "-y", "iptables", "squid"},
296
+ // {"ip", "addr", "add", "10.0.0.254/24", "dev", "eth1"},
297
+ // {"ip", "link", "set", "eth1", "up"},
298
+ // {"sysctl", "-w", "net.ipv4.ip_forward=1"},
299
+ // {"iptables", "-t", "nat", "-o", "eth0", "-A", "POSTROUTING", "-p", "udp", "--dport", "53", "-j", "MASQUERADE"},
300
+ // } {
301
+ // RunCommandOnNode(in, cmd, proxyName)
302
+ // }
303
+ //
304
+ //// create a simple squid configuration that allows for localnet access. upload it
305
+ //// to the proxy in the right location. restart squid to apply the configuration.
306
+ // tmpfile, err := os.CreateTemp("", "squid-config-*.conf")
307
+ // if err != nil {
308
+ // in.T.Fatalf("Failed to create temp file: %v", err)
309
+ // }
310
+ // defer os.Remove(tmpfile.Name())
311
+ // if _, err = tmpfile.WriteString("http_access allow localnet\n"); err != nil {
312
+ // in.T.Fatalf("Failed to write to temp file: %v", err)
313
+ // }
314
+ // file := File{SourcePath: tmpfile.Name(), DestPath: "/etc/squid/conf.d/ec.conf", Mode: 0644}
315
+ // tmpfile.Close()
316
+ // CopyFileToNode(in, proxyName, file)
317
+ // RunCommandOnNode(in, []string{"systemctl", "restart", "squid"}, proxyName)
318
318
319
319
// set the default route on all other nodes to point to the proxy we just created.
320
320
// this makes it easier to ensure no internet will work on them other than dns and
0 commit comments