#!/usr/bin/env bash DESC="Configuration de r4." run() { . common.sh name="r4" startAndWaitSsh $name configBase $name setForwarding $name cat << EOF | setHosts r4 127.0.0.1 localhost 192.168.3.2 r4 192.168.1.2 s1 192.168.3.1 r1 192.168.5.1 r2 192.168.7.1 r3 192.168.8.2 r5 192.168.6.2 s2 EOF cat << EOF | setInterfaces r4 # The loopback network interface auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.3.2 netmask 255.255.255.0 up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.3.1 up route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.3.1 auto eth1 iface eth1 inet static address 192.168.8.1 netmask 255.255.255.0 gateway 192.168.8.2 up route add -net 192.168.5.0 netmask 255.255.255.0 gw 192.168.8.2 up route add -net 192.168.4.0 netmask 255.255.255.0 gw 192.168.8.2 EOF endConfig }