File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 11
11
Once you think the script has run long enough, kill run.sh and look at
12
12
valgrind.log. You have to clean up after the script yourself, e.g. kill
13
13
mock\_ auth.py separately and run ** ./generate_interfaces.sh stop**
14
+
15
+ ### Note on ARP tables ###
16
+
17
+ Although generate\_ interfaces.sh will add random MAC addresses
18
+ to the virtual interfaces, these will not show up in the local
19
+ ARP table. The ARP table only lists remote systems. Even with the
20
+ ** publish** flag set, the ARP table entry will list an all-zero MAC
21
+ address. For this reason, the script generates a fake ARP table
22
+ and passes it to wifidog with the ** -a** switch.
23
+
24
+ The macvlan type virtual interface used by generate\_ interfaces.sh
25
+ is still useful if you load-test a remote wifidog instance. In this case,
26
+ the remote ARP table will (hopefully) be populated correctly.
Original file line number Diff line number Diff line change @@ -7,17 +7,18 @@ PREFIX="mac"
7
7
# don't touch resolv.conf
8
8
DHCP=" dhcpcd --waitip -C resolv.conf"
9
9
# DHCP="dhclient -v"
10
-
11
10
NET=" 10.0.10."
11
+ ARPTABLE=" /tmp/arp"
12
12
13
+ COUNT=$2
13
14
14
15
function start() {
15
- echo " IP address HW type Flags HW address Mask Device" > /tmp/arp
16
+ echo " IP address HW type Flags HW address Mask Device" > $ARPTABLE
16
17
# Add internal address for GW
17
18
sudo ip link add internal0 link $IF type macvlan mode bridge || exit 1
18
19
sudo ip addr add ${NET} 254 dev internal0
19
20
sudo ip link set internal0 up || exit 2
20
- for i in ` seq 0 9 ` ; do
21
+ for i in ` seq 0 $COUNT ` ; do
21
22
echo " Add link $i "
22
23
# sudo ip link add virtual0 link eth0 type macvlan mode bridge
23
24
sudo ip link add ${PREFIX}${i} link $IF type macvlan mode bridge || exit 1
@@ -32,13 +33,13 @@ function start() {
32
33
# when using DHCP, the interface would immediately
33
34
# go down?
34
35
# sudo $DHCP ${PREFIX}${i} || exit 3
35
- echo " ${NET} $(( $i + 1 )) 0x1 0x2 $MAC * ${PREFIX}${i} " >> /tmp/arp
36
+ echo " ${NET} $(( $i + 1 )) 0x1 0x2 $MAC * ${PREFIX}${i} " >> $ARPTABLE
36
37
done
37
38
}
38
39
39
40
function stop() {
40
41
sudo ip link del internal0 2> /dev/null || true
41
- for i in ` seq 0 9 ` ; do
42
+ for i in ` seq 0 $COUNT ` ; do
42
43
echo " Deleting link $i "
43
44
sudo ip link del ${PREFIX}${i} 2> /dev/null || true
44
45
done
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ COUNT=40
3
4
4
5
echo " Make sure to configure GatewayInterface in wifidog_mock.conf"
5
6
6
- ./generate_interfaces.sh start || exit 1
7
+ ./generate_interfaces.sh start $COUNT || exit 1
7
8
8
9
./mock_auth.py &
9
10
10
11
# trace-children is necessary because of the libtool wrapper -.-
11
12
# sudo valgrind --leak-check=full --trace-children=yes --trace-children-skip=/bin/sh \
12
13
# --log-file=valgrind.log ../../src/wifidog -d 7 -f -c wifidog-mock.conf 2> wifidog.log &
13
14
14
- ../../src/wifidog -d 7 -f -c wifidog-mock.conf 2> wifidog.log &
15
+ ../../src/wifidog -d 7 -f -c wifidog-mock.conf -a /tmp/arp 2> wifidog.log &
15
16
16
17
IF=` grep GatewayInterface wifidog-mock.conf | cut -f 2 -d ' ' `
17
18
18
19
echo " Waiting for wifidog to come up"
19
20
20
21
sleep 10
21
- ./fire_requests.py $IF mac 9
22
+ ./fire_requests.py $IF mac $COUNT
22
23
23
24
# ./generate_interfaces.sh stop
24
25
You can’t perform that action at this time.
0 commit comments