aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/configure
blob: 9d47fe69ead3e64a0203720009c7a1c85a0488b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# This file is part of Firejail project
# Copyright (C) 2014-2016 Firejail Authors
# License GPL v2

brctl addbr br0
ifconfig br0 10.10.20.1/29 up
# NAT masquerade
iptables -t nat -A POSTROUTING -o eth0 -s 10.10.20.0/29 -j MASQUERADE
# port forwarding
# iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.10.20.2:80

brctl addbr br1
ifconfig br1 10.10.30.1/24 up
brctl addbr br2
ifconfig br2 10.10.40.1/24 up
brctl addbr br3
ifconfig br3 10.10.50.1/24 up
brctl addbr br4
ifconfig br4 10.10.60.1/24 up
ip link add link eth0 name eth0.5 type vlan id 5
/sbin/ifconfig eth0.5 10.10.205.10/24 up
ip link add link eth0 name eth0.6 type vlan id 6
/sbin/ifconfig eth0.6 10.10.206.10/24 up
ip link add link eth0 name eth0.7 type vlan id 7
/sbin/ifconfig eth0.7 10.10.207.10/24 up

# network namespace
ip netns add red