Skip to content

Commit de4d54a

Browse files
committed
Try out ipv6 for tc and pfctl (on localhost)
1 parent 4e762e2 commit de4d54a

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

lib/localHostPfctl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function start(rtt) {
2020
);
2121

2222
await shell(
23-
'echo "dummynet out from any to 127.0.0.1 pipe 1" | sudo pfctl -f -'
23+
'echo "dummynet out inet from any to 127.0.0.1 pipe 1\ndummynet out inet6 from any to ::1 pipe 1" | sudo pfctl -f -'
2424
);
2525

2626
await sudo('pfctl', '-E');

lib/tc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,30 @@ async function setup(defaultInterface) {
7474
'dev',
7575
'ifb0'
7676
);
77+
await sudo(
78+
'tc',
79+
'filter',
80+
'add',
81+
'dev',
82+
defaultInterface,
83+
'parent',
84+
'ffff:',
85+
'protocol',
86+
'ipv6',
87+
'u32',
88+
'match',
89+
'u32',
90+
'0',
91+
'0',
92+
'flowid',
93+
'1:1',
94+
'action',
95+
'mirred',
96+
'egress',
97+
'redirect',
98+
'dev',
99+
'ifb0'
100+
);
77101
}
78102

79103
async function setLimits(up, down, halfWayRTT, packetLoss, indexFace) {

0 commit comments

Comments
 (0)