Autore Topic: DG834GT e OpenWRT...assegnare una porta dello switch come WAN  (Letto 2295 volte)

Banias

  • Novellino
  • *
  • Post: 2
    • Mostra profilo
DG834GT e OpenWRT...assegnare una porta dello switch come WAN
« il: Agosto 09, 2010, 06:10:53 pm »
Bene...

Come avrete intuito dal titolo, mi ritrovo con un NetGear DG834GT su cui ho installato tramite seriale X-WRT Kamikaze (l'ho scaricato dalla directory snapshot)...

Ho letto in giro per la rete che ? possibile assegnare una porta dello switch in modo tale che questa venga usata come porta WAN...

Ho cercato di capire come fare, ma tuttavia non ci sono riuscito...

L'unica cosa che mi sembra di aver capito ? che ? necessario creare delle vlan, precisamente vlan0 e vlan1, e configurare il il file /etc/config/network affinch? wan e lan siano mappate ad-hoc, e quindi ad esempio porta 1 per la wan e le rimanenti per la lan.

Inoltre ho cercato di installare OpenWRT 8.09.2 con la GUI LuCI ma purtroppo ottengo un kernel panic durante il caricamento...

Consigli ?

truthahn

  • Global Moderator
  • Hero Member
  • *****
  • Post: 1546
    • Mostra profilo
Re: DG834GT e OpenWRT...assegnare una porta dello switch come WAN
« Risposta #1 il: Agosto 18, 2010, 10:47:00 am »
Il DG834GT ha 4 porte...
prova cos?..

Codice: [Seleziona]
config 'switch' 'eth0'
        option 'vlan0' '0 1 2 4*'
        option 'vlan1' '3 4'

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'

config 'interface' 'lan'
        option 'type' 'bridge'
        option 'ifname' 'eth0.0'
        option 'proto' 'static'
        option 'netmask' '255.255.255.0'
        option 'dns' '8.8.8.8'
        option 'ipaddr' '192.168.1.1'
        option 'gateway' '192.168.1.1'

config 'interface' 'wan'
        option 'ifname' 'eth0.1'
        option 'proto' 'static'
        option 'type' 'bridge'
        option 'ipaddr' '192.168.2.2'
        option 'netmask' '255.255.255.0'
        option 'dns' '8.8.8.8'
        option 'gateway' '192.1689.2.1'

o cos? per le nuove versioni...

Codice: [Seleziona]
config 'switch' 'eth1'
option 'enable' '1'
option 'enable_vlan' '1'
option 'reset' '1'

config 'switch_vlan' 'vlan0'
option 'vlan' '0'
option 'device' 'eth1'
option 'ports' '1 2 3 5*'

config 'switch_vlan' 'vlan1'
option 'vlan' '1'
option 'device' 'eth1'
option 'ports' '0 5t'

config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'

config 'interface' 'lan'
option 'type' 'bridge'
option 'ifname' 'eth1.0'
option 'proto' 'static'
option 'ipaddr' '192.168.1.1'
option 'netmask' '255.255.255.0'
option 'nat' '1'
option 'mtu' '1500'

config 'interface' 'wan'
option 'ifname' 'eth1.1'
option 'mtu' '1492'
option 'proto' 'dhcp'

nel secondo caso, come vedi, la wan si prende i valori da un dhcp

ciusss89

  • Full Member
  • ***
  • Post: 106
    • Mostra profilo
    • E-mail
Re: DG834GT e OpenWRT...assegnare una porta dello switch come WAN
« Risposta #2 il: Luglio 25, 2011, 05:26:24 pm »
Ciao...

Io ho un problema analogo, devo settare come wan 3 delle 4 porte dello swicht e come lan l'ultima. L'hardware sulla quale opero ? una Vodafone station.


Sono riuscito andando ad intuito a fare una cosa pi? o meno funzionanete, ma vorrei capirci qualcosa per realizzare qualcosa che funzioni.

La configurazione interessa il file /etc/config/nerwork

Al suo interno:

1) Abilito lo swicht mediante il seguente paragrago:

Codice: [Seleziona]
onfig 'switch' 'eth1'
   option 'enable'      '1'
   option 'enable_vlan' '1'
   option 'reset'       '1'

2) Qui gi? non capisco...

Codice: [Seleziona]
config 'switch_vlan' 'vlan0'
option 'vlan' '0'
option 'device' 'eth1'
option 'ports' '1 2 3 5*'

Le porte fisiche vanno da 1 a 5, il 5 fa riferimento alla cpu o qualcosa di simile. L'option Vlan, si riferisce alla porta 1, il device ? sempre quello, ma la regola ports, 1 2 3 5 che signofica??
ROUTER :D
ROUTER STATION PRO | VODAFONE STATION | FONERA 2G | DIR615 |

truthahn

  • Global Moderator
  • Hero Member
  • *****
  • Post: 1546
    • Mostra profilo
Re: DG834GT e OpenWRT...assegnare una porta dello switch come WAN
« Risposta #3 il: Luglio 25, 2011, 06:17:36 pm »
onfig 'switch' 'eth1'
   option 'enable' '1'
   option 'enable_vlan' '1'
   option 'reset' '1'

config 'switch_vlan' 'vlan0'
   option 'vlan' '0'
   option 'device' 'eth1'
   option 'ports' '1 2 3 5*'

config 'switch_vlan' 'vlan1'
   option 'vlan' '1'
   option 'device' 'eth1'
   option 'ports' '0 5t'

cos? facendo vlan0 avr? in groppone la seconda terza e quarta porta e la vlan1 la prima
per il senso di quel "*" (stile broadcom) o "t" ecco dal wiki di openwrt...

In the option ports line, a number indicates that the specified vlan includes the port with that number. If the number is followed by a "t" then packets transmitted out that port on this VLAN are tagged, and that packets received on that port may be received with this VLAN tag. 5 is generally the CPU or 'internal' port and is generally always tagged. Any other suffix is ignored. (In particular, Broadcom kmod-switch style interfaces use "*" and "u" to indicate PVID and untagged ports, but these designations are ignored by swconfig.)

So, '0 1 2 3 5t' would mean that packets on this VLAN are transmitted untagged when leaving ports 0, 1, 2 and 3, but tagged when leaving port 5 (generally the CPU internal port as described above).

ciusss89

  • Full Member
  • ***
  • Post: 106
    • Mostra profilo
    • E-mail
Re: DG834GT e OpenWRT...assegnare una porta dello switch come WAN
« Risposta #4 il: Agosto 22, 2011, 10:28:00 pm »
onfig 'switch' 'eth1'
   option 'enable' '1'
   option 'enable_vlan' '1'
   option 'reset' '1'

config 'switch_vlan' 'vlan0'
   option 'vlan' '0'
   option 'device' 'eth1'
   option 'ports' '1 2 3 5*'

config 'switch_vlan' 'vlan1'
   option 'vlan' '1'
   option 'device' 'eth1'
   option 'ports' '0 5t'

cos? facendo vlan0 avr? in groppone la seconda terza e quarta porta e la vlan1 la prima
per il senso di quel "*" (stile broadcom) o "t" ecco dal wiki di openwrt...

In the option ports line, a number indicates that the specified vlan includes the port with that number. If the number is followed by a "t" then packets transmitted out that port on this VLAN are tagged, and that packets received on that port may be received with this VLAN tag. 5 is generally the CPU or 'internal' port and is generally always tagged. Any other suffix is ignored. (In particular, Broadcom kmod-switch style interfaces use "*" and "u" to indicate PVID and untagged ports, but these designations are ignored by swconfig.)

So, '0 1 2 3 5t' would mean that packets on this VLAN are transmitted untagged when leaving ports 0, 1, 2 and 3, but tagged when leaving port 5 (generally the CPU internal port as described above).

Codice: [Seleziona]
root@VodafoneStation:~# cat /etc/config/network
config 'switch' 'eth1'
        option 'enable_vlan' '1'
        option 'reset' '1'

## LAN
config 'switch_vlan' 'vlan0'
option 'vlan' '0'
option 'device' 'eth1'
option 'ports' '2 3 5*'

## WAN
config 'switch_vlan' 'vlan1'
option 'vlan' '1'
option 'device' 'eth1'
option 'ports' '0 1 5t'

config 'interface' 'wan'
option 'ifname' 'eth1.1'
option 'proto' 'dhcp'

config 'interface' 'wan2'
        option 'ifname' 'eth1.2'
        option 'proto' 'dhcp'

config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'

config 'interface' 'lan'
option 'proto' 'static'
option 'netmask' '255.255.255.0'
option 'ipaddr' '192.168.10.100'
option 'type' 'bridge'
option 'ifname' 'eth1.3'
root@VodafoneStation:~#

Sto provando questa configurazione, vorrei imparare a configurare le porte in base alle eseginze 2 wan | 2 lan o 3 wan | 1 lan.
Questa configrazione quella dell'esempio che ho riportato, funziona a caso nel senso che la wan corrispondente alla alla porta 1 riceve l'ip, la porta 2 no.

COrrezioni?
ROUTER :D
ROUTER STATION PRO | VODAFONE STATION | FONERA 2G | DIR615 |

BoNoVoX

  • Administrator
  • Hero Member
  • ******
  • Post: 2093
    • Mostra profilo
Re: DG834GT e OpenWRT...assegnare una porta dello switch come WAN
« Risposta #5 il: Agosto 24, 2011, 03:47:05 pm »
Interessante, esiste una guida su come caricare il firmware?
Wireless anywhere, anyhow, anytime for anybody

ciusss89

  • Full Member
  • ***
  • Post: 106
    • Mostra profilo
    • E-mail
Re: DG834GT e OpenWRT...assegnare una porta dello switch come WAN
« Risposta #6 il: Agosto 24, 2011, 08:47:21 pm »
Interessante, esiste una guida su come caricare il firmware?

Per quale dispostitivo?
ROUTER :D
ROUTER STATION PRO | VODAFONE STATION | FONERA 2G | DIR615 |