System Linux Network : SLN

Presque aucune configurations ! ;)


Pourquoi se lancer dans l'explication de la configuration d'une connexion ?
Parce que c'est la seule chose néssécaire et suffisante poue être connecté à l'Internet !

Prérequis :
  1. Les sources de votre noyaux : kernel-source
  2. Pilote ATM : liblinux-atm1-2.4.0-2mdk.rpm
  3. glibc-devel ou glibc-static-devel
  4. gcc, gcc-c++
  5. pciutils
  6. le driver Bewan PCI ST Go... Il faut s'enregistrer !

Installation :
Il faut décompacté le driver !
Il crée un répertoire unicorn !
un :

$ cd unicorn
$ make
# make install

Quelques Warnings peuvent apparaitre ???
On vérifie que le module soit bien chargé !

# lsmod - grep uni
unicorn_pci_eth 782416 1

On édite unicorn/scripts/unicorn-ipoatm
#!/bin/sh

# Source function library.
. /etc/rc.d/init.d/functions

#LOC_IP=0.0.0.0
#NETMASK=255.255.255.255
#GW=0.0.0.0

# set to correct product (USB or PCI)
UNICORN="unicorn_pci_eth"
#UNICORN="unicorn_usb_eth"

# ANSI=1,G.lite=2,MULTI=3,G.dmt=4,
MODULATION=4

# default VPI, VCI and encapsulation
VPI=8
VCI=36

# standard setting for IP over ATM
PROTOCOL=ipoatm
ENCAPS=null

# Interface Name
interface="dsl0"

echo -n "$1 $UNICORN $PROTOCOL $VPI.$VCI $ENCAPS"

stop () {
	/sbin/ifconfig $interface down >/dev/null 2>&1
	/sbin/modprobe -r $UNICORN >/dev/null 2>&1
	return $?
}

start() {
	/sbin/modprobe $UNICORN PROTOCOL=$PROTOCOL ActivationMode=$MODULATION VPI=$VPI VCI=$VCI
   	[ ! "$?" = 0 ] && return $?
	/sbin/ifconfig $interface up
	#/sbin/ifconfig dsl $LOC_IP netmask $NETMASK
	#/sbin/route add gw $GW
	return 0
}

case "$1" in
    stop)
	stop
	;;

    start)
	start
	;;

    restart)
	stop
	start
	;;

    *)
	echo $"Usage: $0 {start|stop|restart}"
	exit 1
esac

RETVAL=$?
if [ $RETVAL = 0 ]; then
    echo_success
else
    echo_failure
fi
echo
exit $RETVAL


Il faut créer un script de connexion appelé "modem" qu'il soit éxécutable par root et placé dans /etc/init.d


#!/bin/sh
# script demarrage modem Bewan PCI ST

rep="/logical-disk/data/SOURCES/unicorn" <---- à personnaliser

if [ "`whoami`" != "root" ]; then
  echo "You must launch this script with root privileges. Enter root password."
  exec su -c "$0 $@"
  exit 1
fi

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

start() {
$rep/scripts/unicorn-ipoatm start;
dhcpcd dsl0;
cat /etc/resolv.conf.ok > /etc/resolv.conf  <----- pas obligatoire
/etc/init.d/named restart && /etc/init.d/shorewall restart && echo "OK !"; <---- redémarrage résolution et firewall
echo "Démarrage Modem";
#killall tail;
}

stop() {
	# Stop daemons.
	killall dhcpcd;  <----- Tue le DHCP
	rm -f /etc/dhcpc/*.pid; <----- Efface le PID associé
	$rep/scripts/unicorn-ipoatm stop;
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart)
	stop
	start
	RETVAL=$?
	;;
  *)
	gprintf "Usage: /etc/init.d/modem {start|stop|restart}\n"
	exit 1
esac

exit $RETVAL


/etc/resolv.conf.ok

search system-linux.net # parce que j'ai un DNS nameserver 82.67.59.175 # parce que j'ai un DNS nameserver 192.168.1.1 # parce que j'ai un DNS

Le script modem doit être activé au démarrage !
ln -s /etc/init.d/modem /etc/rc5.d/S30modem
Pour ceux qui ne veulent pas l'activer au démarrage, j'ai fait une appli qui lance ou arrète le modem !
Le tar.gz
Il faut bien avoir nommé le script "modem" et qu'il soit dans /etc/init.d et éxecutable !

Navigation Précédent     index15.php     Suite
Informations légales

Valid HTML 4.01! Valid CSS!