Update network command setup_network.sh

ifconfig and brctl are deprecated commands.
They are replaced with ip command.

Story: 2004646
Task: 28598

Change-Id: I4a9b63f5437fc9372a169216ee62f239bce55b3c
Signed-off-by: Felipe de Jesus Ruiz Garcia <felipe_57@live.com.mx>
Signed-off-by: Felipe de Jesus Ruiz Garcia <felipe.de.jesus.ruiz.garcia@intel.com>
This commit is contained in:
Felipe de Jesus Ruiz Garcia 2018-12-17 11:02:35 -06:00
parent 5e28cda208
commit 6e0fbcfd89
1 changed files with 6 additions and 5 deletions

View File

@ -28,11 +28,12 @@ if [[ -r /sys/class/net/${BRIDGE_INTERFACE}1 ]]; then
fi
for i in {1..4}; do
sudo brctl addbr ${BRIDGE_INTERFACE}$i
sudo ip link add ${BRIDGE_INTERFACE}$i type bridge
done
sudo ifconfig ${BRIDGE_INTERFACE}1 $EXTERNAL_IP up
sudo ifconfig ${BRIDGE_INTERFACE}2 up
sudo ifconfig ${BRIDGE_INTERFACE}3 up
sudo ifconfig ${BRIDGE_INTERFACE}4 up
sudo ip addr add $EXTERNAL_IP dev ${BRIDGE_INTERFACE}1
sudo ip link set ${BRIDGE_INTERFACE}1 up
sudo ip link set ${BRIDGE_INTERFACE}2 up
sudo ip link set ${BRIDGE_INTERFACE}3 up
sudo ip link set ${BRIDGE_INTERFACE}4 up
sudo iptables -t nat -A POSTROUTING -s $EXTERNAL_NETWORK -j MASQUERADE