A R Karthick | 1fa6654 | 2017-08-10 14:15:29 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Matteo Scandolo | 48d3d2d | 2017-08-08 13:05:27 -0700 | [diff] [blame] | 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 | |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 17 | |
| 18 | sudo brctl addbr fabric |
| 19 | sudo ip link set fabric up |
| 20 | sudo ip link add veth0 type veth peer name veth1 |
| 21 | sudo ip link set veth0 up |
| 22 | sudo ip link set veth1 up |
| 23 | sudo brctl addif fabric veth0 |
| 24 | sudo brctl addif fabric eth1 |
| 25 | sudo ip addr flush eth1 |
| 26 | sudo ip link set address 00:00:00:00:00:01 dev fabric |
| 27 | sudo ip link set address 00:00:00:00:00:01 dev eth1 |
| 28 | sudo ip address add 20.0.0.1/24 dev fabric |
| 29 | sudo ip address add 10.168.0.1/24 dev fabric |
| 30 | sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE |