Skip to content

Commit 336d8ba

Browse files
committed
fix for debug file and more
1 parent c8557ea commit 336d8ba

File tree

1 file changed

+18
-39
lines changed

1 file changed

+18
-39
lines changed

examples/eap-tls/eap-tls-auth.py

+18-39
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,26 @@ def topology():
1414
cwd = os.getcwd()
1515
net = Mininet_wifi()
1616

17+
config = 'key_mgmt=WPA-EAP,' \
18+
'scan_ssid=1,' \
19+
'identity="[email protected]",' \
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+
1726
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-
'identity="[email protected]",'
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-
'identity="[email protected]",'
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)
4532

4633
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,
5137
config='eap_server=1,'
5238
'ieee8021x=1,'
5339
'wpa=2,'
@@ -60,8 +46,7 @@ def topology():
6046
'server_cert={}/examples/eap-tls/CA/server.crt,'
6147
'private_key={}/examples/eap-tls/CA/server.key,'
6248
'eap_user_file={}/examples/eap-tls/eap_users'
63-
.format(cwd, cwd, cwd, cwd),
64-
client_isolation=True)
49+
.format(cwd, cwd, cwd, cwd))
6550

6651
info("*** Configuring nodes\n")
6752
net.configureNodes()
@@ -90,11 +75,5 @@ def topology():
9075

9176

9277
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")
9978
setLogLevel('info')
10079
topology()

0 commit comments

Comments
 (0)