Commit feecaa63 authored by Francklin Simo's avatar Francklin Simo

Add makefiles for easy OpenSAND CLI setup

parent b774b48d
# Easy OpenSAND CLI
This is a small piece of software allowing to facility the setup of a minimal OpenSAND platform following a step-by-step approach.
Unlike to 'OpenSAND CLI' where you have to manualy run each commands, 'Easy OpenSAND CLI' groups commands by step: configure/clean network and run/stop opensand binaries.
Technically, commands are grouped within makefiles and organized into Phony targets or recipes to be executed. Where a recipe consists to one or more actions to carry out.
Its provides for both modes, IP and ETH, makefiles to run on each component SAT, GW and ST.
## Pre-requisite
As with OpenSAND CLI, iproute2 and make packages are required. You can install them from your command line terminal by issuing
```bash
apt-get install iproute2 make
```
## Usage
It is assumed that the simulation file are already configured and installed on each component, as well as this tool.
You need to modify each makefile to adapt them to your platform by correctly replacing variables value.
Once this done, you have to run makefiles as root from your command line terminal as follows:
```bash
make network
make run
```
First command configure network interfaces and routing, and second one run OpenSAND binary.
If needed, you can run
```bash
make network
make run
```
to respectively stop emualtion and clean network configurations.
EMU_IFACE=ens4
EMU_IFACE_IP=192.168.18.42
LAN_IFACE=ens5
TAP_IFACE=opensand_tap
TAP_IFACE_MAC=00:00:00:00:00:01
BR_IFACE=opensand_br
NET_DIGITS=24
GW_ID=0
CONF_PATH=/etc/opensand_eth/
COLLECTOR_IP=172.20.34.82
all: clean network run
clean:
-ip address del $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
-ip link set dev $(TAP_IFACE) nomaster
-ip link set dev $(LAN_IFACE) nomaster
-ip link del $(TAP_IFACE)
-ip link del $(BR_IFACE)
-ip link set $(EMU_IFACE) down
-ip link set $(LAN_IFACE) down
network:
ip address add $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
ip tuntap add mode tap $(TAP_IFACE)
ip link set dev $(TAP_IFACE) address $(TAP_IFACE_MAC)
ip link add name $(BR_IFACE) type bridge
ip link set dev $(TAP_IFACE) master $(BR_IFACE)
ip link set dev $(LAN_IFACE) master $(BR_IFACE)
brctl setageing $(BR_IFACE) 0
ip link set $(EMU_IFACE) up
ip link set $(BR_IFACE) up
ip link set $(TAP_IFACE) up
ip link set $(LAN_IFACE) up
run:
opensand-gw -i $(GW_ID) -a $(EMU_IFACE_IP) -t $(TAP_IFACE) -c $(CONF_PATH) -f /var/log/opensand/ -r $(COLLECTOR_IP) -l 5362 -s 5361 &
stop:
-pkill opensand-gw
.PHONY: all run network clean stop
EMU_IFACE=ens4
EMU_IFACE_IP=192.168.18.15
NET_DIGITS=24
CONF_PATH=/etc/opensand_eth/
COLLECTOR_IP=172.20.34.82
all: clean network run
clean:
-ip address del $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
-ip link set $(EMU_IFACE) down
network:
ip address add $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
ip link set $(EMU_IFACE) up
run:
opensand-sat -a $(EMU_IFACE_IP) -c $(CONF_PATH) -r $(COLLECTOR_IP) -l 5362 -s 5361 &
stop:
-pkill opensand-sat
.PHONY: all run network clean stop
EMU_IFACE=ens4
EMU_IFACE_IP=192.168.18.1
LAN_IFACE=ens5
TAP_IFACE=opensand_tap
TAP_IFACE_MAC=00:00:00:00:00:02
BR_IFACE=opensand_br
NET_DIGITS=24
ST_ID=1
CONF_PATH=/etc/opensand_eth/
COLLECTOR_IP=172.20.34.82
all: clean network run
clean:
-ip address del $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
-ip link set dev $(TAP_IFACE) nomaster
-ip link set dev $(LAN_IFACE) nomaster
-ip link del $(TAP_IFACE)
-ip link del $(BR_IFACE)
-ip link set $(EMU_IFACE) down
-ip link set $(LAN_IFACE) down
network:
ip address add $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
ip tuntap add mode tap $(TAP_IFACE)
ip link set dev $(TAP_IFACE) address $(TAP_IFACE_MAC)
ip link add name $(BR_IFACE) type bridge
ip link set dev $(TAP_IFACE) master $(BR_IFACE)
ip link set dev $(LAN_IFACE) master $(BR_IFACE)
brctl setageing $(BR_IFACE) 0
ip link set $(EMU_IFACE) up
ip link set $(BR_IFACE) up
ip link set $(TAP_IFACE) up
ip link set $(LAN_IFACE) up
run:
opensand-st -i $(ST_ID) -a $(EMU_IFACE_IP) -t $(TAP_IFACE) -c $(CONF_PATH) -f /var/log/opensand/ -r $(COLLECTOR_IP) -l 5362 -s 5361 &
stop:
-pkill opensand-st
.PHONY: all run network clean stop
EMU_IFACE=ens4
EMU_IFACE_IP=192.168.18.42
LAN_IFACE=ens5
LAN_IFACE_IP=192.168.42.1
TAP_IFACE=opensand_tap
TAP_IFACE_MAC=00:00:00:00:00:01
BR_IFACE=opensand_br
BR_IFACE_IP=192.168.63.254
NET_DIGITS=24
FORWARDING=1
ST_LAN_IP=192.168.1.0/24
ST_BR_IFACE_IP=192.168.63.1
GW_ID=0
CONF_PATH=/etc/opensand_ip/
COLLECTOR_IP=172.20.34.82
all: clean network run
clean:
-ip address del $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
-ip link set dev $(TAP_IFACE) nomaster
-ip address del $(BR_IFACE_IP)/$(NET_DIGITS) dev $(BR_IFACE)
-ip address del $(LAN_IFACE_IP)/$(NET_DIGITS) dev $(LAN_IFACE)
-ip link del $(TAP_IFACE)
-ip link del $(BR_IFACE)
-ip link set $(EMU_IFACE) down
-ip link set $(LAN_IFACE) down
network:
ip address add $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
ip tuntap add mode tap $(TAP_IFACE)
ip link set dev $(TAP_IFACE) address $(TAP_IFACE_MAC)
ip link add name $(BR_IFACE) type bridge
ip address add $(BR_IFACE_IP)/$(NET_DIGITS) dev $(BR_IFACE)
ip link set dev $(TAP_IFACE) master $(BR_IFACE)
brctl setageing $(BR_IFACE) 0
ip address add $(LAN_IFACE_IP)/$(NET_DIGITS) dev $(LAN_IFACE)
ip link set $(EMU_IFACE) up
ip link set $(BR_IFACE) up
ip link set $(TAP_IFACE) up
ip link set $(LAN_IFACE) up
sysctl -w net.ipv4.conf.$(EMU_IFACE).forwarding=$(FORWARDING)
sysctl -w net.ipv4.conf.$(BR_IFACE).forwarding=$(FORWARDING)
sysctl -w net.ipv4.conf.$(LAN_IFACE).forwarding=$(FORWARDING)
sysctl -w net.ipv4.ip_forward=$(FORWARDING)
ip route add $(ST_LAN_IP) via $(ST_BR_IFACE_IP)
run:
opensand-gw -i $(GW_ID) -a $(EMU_IFACE_IP) -t $(TAP_IFACE) -c $(CONF_PATH) -f /var/log/opensand/ -r $(COLLECTOR_IP) -l 5362 -s 5361 &
stop:
-pkill opensand-gw
.PHONY: all run network clean stop
EMU_IFACE=ens4
EMU_IFACE_IP=192.168.18.15
NET_DIGITS=24
CONF_PATH=/etc/opensand_ip/
COLLECTOR_IP=172.20.34.82
all: clean network run
clean:
-ip address del $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
-ip link set $(EMU_IFACE) down
network:
ip address add $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
ip link set $(EMU_IFACE) up
run:
opensand-sat -a $(EMU_IFACE_IP) -c $(CONF_PATH) -r $(COLLECOR_IP) -l 5362 -s 5361 &
stop:
-pkill opensand-sat
.PHONY: all run network clean stop
EMU_IFACE=ens4
EMU_IFACE_IP=192.168.18.1
LAN_IFACE=ens5
LAN_IFACE_IP=192.168.0.1
TAP_IFACE=opensand_tap
TAP_IFACE_MAC=00:00:00:00:00:02
BR_IFACE=opensand_br
BR_IFACE_IP=192.168.63.1
NET_DIGITS=24
FORWARDING=1
GW_LAN_IP=192.168.42.0/24
GW_LAN_IFACE_IP=192.168.63.254
GW_BR_IFACE_IP=192.168.63.254
ST_ID=1
CONF_PATH=/etc/opensand_ip/
COLLECTOR_IP=172.20.34.82
all: clean network run
clean:
-ip address del $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
-ip link set dev $(TAP_IFACE) nomaster
-ip address del $(BR_IFACE_IP)/$(NET_DIGITS) dev $(BR_IFACE)
-ip address del $(LAN_IFACE_IP)/$(NET_DIGITS) dev $(LAN_IFACE)
-ip link del $(TAP_IFACE)
-ip link del $(BR_IFACE)
-ip link set $(EMU_IFACE) down
-ip link set $(LAN_IFACE) down
network:
ip address add $(EMU_IFACE_IP)/$(NET_DIGITS) dev $(EMU_IFACE)
ip tuntap add mode tap $(TAP_IFACE)
ip link set dev $(TAP_IFACE) address $(TAP_IFACE_MAC)
ip link add name $(BR_IFACE) type bridge
ip address add $(BR_IFACE_IP)/$(NET_DIGITS) dev $(BR_IFACE)
ip link set dev $(TAP_IFACE) master $(BR_IFACE)
brctl setageing $(BR_IFACE) 0
ip address add $(LAN_IFACE_IP)/$(NET_DIGITS) dev $(LAN_IFACE)
ip link set $(EMU_IFACE) up
ip link set $(BR_IFACE) up
ip link set $(TAP_IFACE) up
ip link set $(LAN_IFACE) up
sysctl -w net.ipv4.conf.$(EMU_IFACE).forwarding=$(FORWARDING)
sysctl -w net.ipv4.conf.$(BR_IFACE).forwarding=$(FORWARDING)
sysctl -w net.ipv4.conf.$(LAN_IFACE).forwarding=$(FORWARDING)
sysctl -w net.ipv4.ip_forward=$(FORWARDING)
ip route add $(GW_LAN_IP) via $(GW_BR_IFACE_IP)
run:
opensand-st -i $(ST_ID) -a $(EMU_IFACE_IP) -t $(TAP_IFACE) -c $(CONF_PATH) -f /var/log/opensand/ -r $(COLLECTOR_IP) -l 5362 -s 5361 &
stop:
-pkill opensand-st
.PHONY: all run network clean stop
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment