blob: 889be9bc66bbb802b6ec3ed5aed1170bd0a12750 [file] [log] [blame]
Matteo Scandolo48d3d2d2017-08-08 13:05:27 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
ChetanGaonker901727c2016-11-29 14:05:03 -080017#!/bin/bash
18
19sudo brctl addbr fabric
20sudo ip link set fabric up
21sudo ip link add veth0 type veth peer name veth1
22sudo ip link set veth0 up
23sudo ip link set veth1 up
24sudo brctl addif fabric veth0
25sudo brctl addif fabric eth1
26sudo ip addr flush eth1
27sudo ip link set address 00:00:00:00:00:01 dev fabric
28sudo ip link set address 00:00:00:00:00:01 dev eth1
29sudo ip address add 20.0.0.1/24 dev fabric
30sudo ip address add 10.168.0.1/24 dev fabric
31sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE