Auteur Sujet: Remplacer sa Livebox par un routeur Ubiquiti Edgemax  (Lu 1575748 fois)

0 Membres et 19 Invités sur ce sujet

raphoun

  • Abonné Orange Fibre
  • *
  • Messages: 16
  • Noisy le grand (93)
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #660 le: 29 août 2014 à 10:30:57 »
Hello,

Ca y est j'ai reçu le matos, j'ai configuré hier soir vite fait avec juste l'ERL, internet fonctionne, la télé aussi mais pas le replay.
Je compte m'en occuper cet aprem, une idée d'où ça peut venir?  :) Je me suis sans doute foiré sur les routes statiques!

blegoff

  • Abonné Orange Fibre
  • *
  • Messages: 241
  • FTTH 1000/250 Mb/s sur Montrouge (92)
    • O.S Technologies
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #661 le: 29 août 2014 à 11:04:34 »
verifie tes routes statiques.

pour la VOD si tu as la tv qui marche bien le probleme viens des routes.

as tu bien mis ces 3 scripts dans le repertoire /config/scripts/post-config.d

script 10-vlan.sh

#!/bin/bash
doneit='/var/lib/vlan_installed'
packages='vlan'
pidfile=/var/run/igmpproxy.pid


if [ ! -e $doneit ]; then
  sudo dpkg --configure -a
  apt update
  apt install -y $packages
fi
if [ $? == 0 ]; then
    echo package install successful
    modprobe 8021q

    /sbin/vconfig set_egress_map eth0.840 0 5
    /sbin/vconfig set_egress_map eth0.838 0 4
    /sbin/vconfig set_egress_map eth0.840 1 5
    /sbin/vconfig set_egress_map eth0.838 1 4
    /sbin/vconfig set_egress_map eth0.840 2 5
    /sbin/vconfig set_egress_map eth0.838 2 4
    /sbin/vconfig set_egress_map eth0.840 3 5
    /sbin/vconfig set_egress_map eth0.838 3 4
    /sbin/vconfig set_egress_map eth0.840 4 5
    /sbin/vconfig set_egress_map eth0.838 4 4
    /sbin/vconfig set_egress_map eth0.840 5 5
    /sbin/vconfig set_egress_map eth0.838 5 4
    /sbin/vconfig set_egress_map eth0.840 6 5
    /sbin/vconfig set_egress_map eth0.838 6 4
    /sbin/vconfig set_egress_map eth0.840 7 5
    /sbin/vconfig set_egress_map eth0.838 7 4
    /sbin/vconfig set_egress_map eth0.851 0 6
    /sbin/vconfig set_egress_map eth0.851 1 6
    /sbin/vconfig set_egress_map eth0.851 2 6
    /sbin/vconfig set_egress_map eth0.851 3 6
    /sbin/vconfig set_egress_map eth0.851 6 6
    /sbin/vconfig set_egress_map eth0.851 5 6
    /sbin/vconfig set_egress_map eth0.851 6 6
    /sbin/vconfig set_egress_map eth0.851 7 6
 
    touch $doneit
  else
    echo package install failed
  exit -1
  fi
#kill `cat $pidfile`

dhclient -cf /config/dhclient.conf br0

/sbin/start-stop-daemon --start --startas /sbin/igmpproxy --make-pidfile --pidfile $pidfile --background -- /etc/igmpproxy.conf

exit 0

script 20-route.sh

#!/bin/bash

# Basic paths
SHELL_API=/bin/cli-shell-api
vyatta_sbindir=/opt/vyatta/sbin
dhcp_map_file=/config/dhcpd_static.map

# Basic commands
SET=${vyatta_sbindir}/my_set
DELETE=${vyatta_sbindir}/my_delete
COPY=${vyatta_sbindir}/my_copy
MOVE=${vyatta_sbindir}/my_move
RENAME=${vyatta_sbindir}/my_rename
ACTIVATE=${vyatta_sbindir}/my_activate
DEACTIVATE=${vyatta_sbindir}/my_activate
COMMENT=${vyatta_sbindir}/my_comment
COMMIT=${vyatta_sbindir}/my_commit
DISCARD=${vyatta_sbindir}/my_discard
SAVE=${vyatta_sbindir}/vyatta-save-config.pl

# Init session
session_env=$($SHELL_API getSessionEnv $PPID)
eval $session_env
$SHELL_API setupSession

# Check session
$SHELL_API inSession
if [ $? -ne 0 ]; then
        echo "Can not init session"
        exit 1
fi


br0_ip=$(/sbin/ifconfig br0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}')

subnet_base=`echo $br0_ip | cut -d"." -f1-3`

gateway_ip=$subnet_base".254"




$DELETE protocols static route 80.10.117.120/31
$DELETE protocols static route 81.253.206.0/24
$DELETE protocols static route 81.253.210.0/23
$DELETE protocols static route 81.253.214.0/23
$DELETE protocols static route 172.19.20.0/23
$DELETE protocols static route 172.20.224.167/32
$DELETE protocols static route 172.23.12.0/22
$DELETE protocols static route 193.253.67.88/29
$DELETE protocols static route 193.253.153.227/32
$DELETE protocols static route 193.253.153.228/32


$SET protocols static route 80.10.117.120/31 next-hop $gateway_ip
$SET protocols static route 81.253.206.0/24 next-hop $gateway_ip
$SET protocols static route 81.253.210.0/23 next-hop $gateway_ip
$SET protocols static route 81.253.214.0/23 next-hop $gateway_ip
$SET protocols static route 172.19.20.0/23 next-hop $gateway_ip
$SET protocols static route 172.20.224.167/32 next-hop $gateway_ip
$SET protocols static route 172.23.12.0/22 next-hop $gateway_ip
$SET protocols static route 193.253.67.88/29 next-hop $gateway_ip
$SET protocols static route 193.253.153.227/32 next-hop $gateway_ip
$SET protocols static route 193.253.153.228/32 next-hop $gateway_ip

$COMMIT
$SAVE

script 30-dns.sh

#!/bin/bash
#
# Author: leon@leonsio.com
# Licence: BSD
# Version: 1.0
#

# Basic paths
SHELL_API=/bin/cli-shell-api
vyatta_sbindir=/opt/vyatta/sbin
dhcp_map_file=/config/dhcpd_static.map

# Basic commands
SET=${vyatta_sbindir}/my_set
DELETE=${vyatta_sbindir}/my_delete
COPY=${vyatta_sbindir}/my_copy
MOVE=${vyatta_sbindir}/my_move
RENAME=${vyatta_sbindir}/my_rename
ACTIVATE=${vyatta_sbindir}/my_activate
DEACTIVATE=${vyatta_sbindir}/my_activate
COMMENT=${vyatta_sbindir}/my_comment
COMMIT=${vyatta_sbindir}/my_commit
DISCARD=${vyatta_sbindir}/my_discard
SAVE=${vyatta_sbindir}/vyatta-save-config.pl

# Some arrays
declare -A STATIC_HOSTS
declare -A STATIC_DHCP
declare -A STATIC_DOMAIN
declare -A HOST_ADD
declare -A HOST_DELETE
declare -A HOST_CHANGE

# Init session
session_env=$($SHELL_API getSessionEnv $PPID)
eval $session_env
$SHELL_API setupSession

# Check session
$SHELL_API inSession
if [ $? -ne 0 ]; then
echo "Can not init session"
exit 1
fi

# Part 1: Get all static host mappings
host_map_list=$($SHELL_API listNodes system static-host-mapping host-name)
eval "HOSTS=($host_map_list)"

for host in "${HOSTS[@]}";
  do
host_ip=$($SHELL_API returnValue system static-host-mapping host-name $host inet)
STATIC_HOSTS[$host]=$host_ip
  done

# Part 2: Get DHCP static leases
dhcp_networks=$($SHELL_API listNodes service dhcp-server shared-network-name)
eval "DHCP_NETWORKS=($dhcp_networks)"

for network in "${DHCP_NETWORKS[@]}";
  do
# 2.1 get subnets
dhcp_subnets=$($SHELL_API listNodes service dhcp-server shared-network-name $network subnet)
eval "DHCP_SUBNETS=($dhcp_subnets)"
for subnet in "${DHCP_SUBNETS[@]}";
do
# 2.2 entries
dhcp_static_leases=$($SHELL_API listNodes service dhcp-server shared-network-name $network subnet $subnet static-mapping)
eval "DHCP_STATIC_LEASES=($dhcp_static_leases)"
for host_name in "${DHCP_STATIC_LEASES[@]}";
do
#  2.3 host (str to lower)
host_ip=$($SHELL_API returnValue service dhcp-server shared-network-name $network subnet $subnet static-mapping $host_name ip-address)
STATIC_DHCP[${host_name}]=$host_ip

host_domain=$($SHELL_API returnValue service dhcp-server shared-network-name $network subnet $subnet domain-name)
STATIC_DOMAIN[${host_name}]=$host_domain
done
done
  done

# Part 3 search for differences between STATIC_DHCP and STATIC_HOSTS
for key in "${!STATIC_DHCP[@]}"
do
value=${STATIC_DHCP[$key]}
# 3.1 Search for host entry
if [[ ${STATIC_HOSTS[$key]} ]]; then
# 3.2 search for changes between entries
if [[ ${STATIC_HOSTS[$key]} != ${STATIC_DHCP[$key]} ]]; then
HOST_CHANGE[$key]=$value
fi
    else # 3.3 search for new entries
HOST_ADD[$key]=$value
    fi
done

# Part 4 read old leases and search for deleted entries
# 4.1 load old static leases
if [ -f $dhcp_map_file ]; then
mapfile -t dhcp_static_map < "$dhcp_map_file"
else
declare -A dhcp_static_map
fi
for dhcp_static_entry in "${dhcp_static_map[@]}"
  do
value=${STATIC_DHCP[$dhcp_static_entry]}
# 4.2 search for new/deleted entries
if ! [[ ${STATIC_DHCP[$dhcp_static_entry]} ]]; then
#  4.3 entry is old STATIC_DHCP entry and must be deleted from hosts list
if [[ ${STATIC_HOSTS[$dhcp_static_entry]} ]]; then
HOST_DELETE[$dhcp_static_entry]=$dhcp_static_entry
fi
fi
  done
# Part 5 commit changes
# 5.1 add new entries
write_changes=0
for host in "${!HOST_ADD[@]}"
  do
domain=${STATIC_DOMAIN[${host_name}]}
fqdn=$host.$domain
$SET system static-host-mapping host-name $host inet ${HOST_ADD[$host]}
if [ -n "$domain" ]; then
$SET system static-host-mapping host-name $host alias $fqdn
fi
if [ $? -ne 0 ]; then
        echo "SET Failed, abort :("
        exit 1
fi
write_changes=1
  done
# 5.2 write changes
for host in "${!HOST_CHANGE[@]}"
  do
        $SET system static-host-mapping host-name $host inet ${HOST_CHANGE[$host]} alias $host.$domain
if [ $? -ne 0 ]; then
        echo "SET Failed, abort :("
        exit 1
fi
write_changes=1
  done
# 5.3 delete old values
for host in "${!HOST_DELETE[@]}"
  do
        $DELETE system static-host-mapping host-name $host
        if [ $? -ne 0 ]; then
                echo "SET Failed, abort :("
                exit 1
        fi
write_changes=1
  done
# only if we have some changes
if [[ $write_changes == 1 ]]; then
# 5.4 commit changes
$COMMIT
# 5.5 save changes
$SAVE
fi
#  Part 6 save new dhcp static map to file
rm -rf $dhcp_map_file
for host in "${!STATIC_DHCP[@]}"
do
echo $host >> $dhcp_map_file
done

une fois que tu as mis ce's 3 scripts tu as juste a redemarrer et tout marche normalement

raphoun

  • Abonné Orange Fibre
  • *
  • Messages: 16
  • Noisy le grand (93)
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #662 le: 29 août 2014 à 15:21:15 »
Je viens de tester en changeant eth0 en eth1 dans ton premier script, ça ne marche tjr pas, je continue de chercher :)
Sinon switch et borne wifi opérationnel, le top  8)

blegoff

  • Abonné Orange Fibre
  • *
  • Messages: 241
  • FTTH 1000/250 Mb/s sur Montrouge (92)
    • O.S Technologies
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #663 le: 29 août 2014 à 15:45:43 »
envoi nous le retour de ces 3 commandes stp, ca permettra de savoir ou ca bloque normalement

en mail privé plutot vu que t'on adresse ip est visible que je soit le seul a te pirater  ;D

show interfaces

ip route

netstat -r

raphoun

  • Abonné Orange Fibre
  • *
  • Messages: 16
  • Noisy le grand (93)
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #664 le: 29 août 2014 à 18:01:12 »
Je t'ai tout envoyé en MP!  ;)

blegoff

  • Abonné Orange Fibre
  • *
  • Messages: 241
  • FTTH 1000/250 Mb/s sur Montrouge (92)
    • O.S Technologies
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #665 le: 31 août 2014 à 20:22:53 »
bon pour mon probleme de port qui ne s'ouvre pas toujours au meme point apres une reconfiguration totale, ca ne marche pas c0mm0n je peux te demander un peu d'aide la dessus ?

c0mm0n

  • Invité
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #666 le: 31 août 2014 à 21:08:48 »
Le port est ouvert :D
Teste depuis ton tel en 3/4G : http://XXX.XXX.XXX.XXX:5000/webman/index.cgi

c0mm0n

  • Invité
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #667 le: 31 août 2014 à 21:10:42 »

blegoff

  • Abonné Orange Fibre
  • *
  • Messages: 241
  • FTTH 1000/250 Mb/s sur Montrouge (92)
    • O.S Technologies
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #668 le: 31 août 2014 à 21:17:10 »
ok donc c'est un probleme de communication entre mon serveur et le routeur donc merci d'avoir testé desolé de t'embeter pour rien

Carcajou

  • Abonné Orange Fibre
  • *
  • Messages: 76
  • Saint-Denis (974)
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #669 le: 05 septembre 2014 à 13:23:44 »
Salut ! :)

Bon, j'y suis presque, la fibre arrive mi-novembre (normalement ^^) chez moi.

Et comme j'ai eu une offre plutôt intéressante avec Sosh pour la Livebox + mobile, je vais avoir la Livebox plus tôt que prévu. A priori fin de semaine prochaine, donc en ADSL pendant 3 mois.

J'ai quand même commandé l'ERL, que je puisse enfin commencer à m'amuser un peu avec. ^^

Mais comme je n'ai pas de modem ADSL, je vais configurer la Livebox en bridge et mettre l'ERL derrière. En mode bridge, elle transmet tout sur le LAN ? Ou que la partie Internet en gardant le téléphone et la TV sur ses autres ports ?
(Chez Orange, je me suis arrêté à la raie verte Wanadoo... Depuis je n'y étais jamais retourné. ^^)

Merci ! :)

c0mm0n

  • Invité
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #670 le: 05 septembre 2014 à 13:26:20 »
Ah ouais le mode bridge :p

Nico

  • Modérateur
  • *
  • Messages: 44 536
  • FTTH 1000/500 sur Paris 15ème (75)
    • @_GaLaK_
Remplacer sa Livebox : configurer un routeur Ubiquiti Edgemax
« Réponse #671 le: 05 septembre 2014 à 13:27:25 »
Le fameux mode bridge :D