@@ -14,40 +14,26 @@ def topology():
14
14
cwd = os .getcwd ()
15
15
net = Mininet_wifi ()
16
16
17
+ config = 'key_mgmt=WPA-EAP,' \
18
+ 'scan_ssid=1,' \
19
+
20
+ 'eap=TLS,' \
21
+ 'ssid="simplewifi",' \
22
+ 'ca_cert="{}/examples/eap-tls/CA/ca.crt",' \
23
+ 'client_cert="{}/examples/eap-tls/CA/client.crt",' \
24
+ 'private_key="{}/examples/eap-tls/CA/client.key"' .format (cwd , cwd , cwd )
25
+
17
26
info ("*** Creating nodes\n " )
18
- sta1 = net .addStation ('sta1' ,
19
- wpasup_flags = '-dd > /tmp/debug1.txt' ,
20
- wpasup_globals = 'eapol_version=2' ,
21
- encrypt = 'wpa2' ,
22
- config = 'key_mgmt=WPA-EAP,'
23
-
24
- 'ssid="simplewifi",'
25
- 'eap=TLS,'
26
- 'scan_ssid=1,'
27
- 'ca_cert="{}/examples/eap-tls/CA/ca.crt",'
28
- 'client_cert="{}/examples/eap-tls/CA/client.crt",'
29
- 'private_key="{}/examples/eap-tls/CA/client.key"'
30
- .format (cwd , cwd , cwd ))
31
-
32
- sta2 = net .addStation ('sta2' ,
33
- wpasup_flags = '-dd > /tmp/debug2.txt' ,
34
- wpasup_globals = 'eapol_version=2' ,
35
- encrypt = 'wpa2' ,
36
- config = 'key_mgmt=WPA-EAP,'
37
- 'scan_ssid=1,'
38
-
39
- 'eap=TLS,'
40
- 'ssid="simplewifi",'
41
- 'ca_cert="{}/examples/eap-tls/CA/ca.crt",'
42
- 'client_cert="{}/examples/eap-tls/CA/client.crt",'
43
- 'private_key="{}/examples/eap-tls/CA/client.key"'
44
- .format (cwd , cwd , cwd ))
27
+ sta1 = net .addStation ('sta1' , wpasup_flags = '-dd -f /tmp/debug1.txt' ,
28
+ wpasup_globals = 'eapol_version=2' , encrypt = 'wpa2' , config = config )
29
+
30
+ sta2 = net .addStation ('sta2' , wpasup_flags = '-dd -f /tmp/debug2.txt' ,
31
+ wpasup_globals = 'eapol_version=2' , encrypt = 'wpa2' , config = config )
45
32
46
33
ap1 = net .addAccessPoint ('ap1' ,
47
- ssid = "simplewifi" ,
48
- hostapd_flags = '-dd > /tmp/hostapd.txt' ,
49
- mode = "g" , channel = "1" , encrypt = 'wpa2' ,
50
- failMode = "standalone" , datapath = 'user' ,
34
+ ssid = "simplewifi" , hostapd_flags = '-dd > /tmp/hostapd.txt' ,
35
+ mode = "g" , channel = "1" , encrypt = 'wpa2' , failMode = "standalone" ,
36
+ datapath = 'user' , client_isolation = True ,
51
37
config = 'eap_server=1,'
52
38
'ieee8021x=1,'
53
39
'wpa=2,'
@@ -60,8 +46,7 @@ def topology():
60
46
'server_cert={}/examples/eap-tls/CA/server.crt,'
61
47
'private_key={}/examples/eap-tls/CA/server.key,'
62
48
'eap_user_file={}/examples/eap-tls/eap_users'
63
- .format (cwd , cwd , cwd , cwd ),
64
- client_isolation = True )
49
+ .format (cwd , cwd , cwd , cwd ))
65
50
66
51
info ("*** Configuring nodes\n " )
67
52
net .configureNodes ()
@@ -90,11 +75,5 @@ def topology():
90
75
91
76
92
77
if __name__ == '__main__' :
93
- if path .exists ("/tmp/debug1.txt" ):
94
- os .remove ("/tmp/debug1.txt" )
95
- if path .exists ("/tmp/debug2.txt" ):
96
- os .remove ("/tmp/debug2.txt" )
97
- if path .exists ("/tmp/hostapd.txt" ):
98
- os .remove ("/tmp/hostapd.txt" )
99
78
setLogLevel ('info' )
100
79
topology ()
0 commit comments