2 package org
.de
.metux
.ip
;
4 import org
.de
.metux
.util
.Exec
;
5 import java
.net
.UnknownHostException
;
7 public class IPSEC_Device
11 public IPSEC_Device(String name
)
16 public boolean Tunnel_delete()
18 return Exec
.exec_command("ifconfig "+if_name
+" down") &&
19 Exec
.exec_command("ipsecadm tunnel del "+if_name
);
22 public boolean Tunnel_add(
26 throws UnknownHostException
28 return Exec
.exec_command("ipsecadm tunnel add "+if_name
+
29 " --local="+Lookup
.getIP_str(local_addr
)+
30 " --remote="+Lookup
.getIP_str(remote_addr
)+
35 public boolean ConfigureIP(
40 throws UnknownHostException
42 return Exec
.exec_command(
44 " inet "+Lookup
.getIP_str(address
)+