blob: e89e16d1b2148649f2e6950ecc2419254129a7a1 [file] [log] [blame]
A R Karthick1fa66542017-08-10 14:15:29 -07001#!/bin/bash
Matteo Scandolo48d3d2d2017-08-08 13:05:27 -07002# 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
18sudo brctl addbr fabric
19sudo ip link set fabric up
20sudo ip link add veth0 type veth peer name veth1
21sudo ip link set veth0 up
22sudo ip link set veth1 up
23sudo brctl addif fabric veth0
24sudo brctl addif fabric eth1
25sudo ip addr flush eth1
26sudo ip link set address 00:00:00:00:00:01 dev fabric
27sudo ip link set address 00:00:00:00:00:01 dev eth1
28sudo ip address add 20.0.0.1/24 dev fabric
29sudo ip address add 10.168.0.1/24 dev fabric
30sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE