Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RISOLTO] Bridge networking su reti differenti
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
medknight
n00b
n00b


Joined: 10 Mar 2007
Posts: 20

PostPosted: Tue Jan 03, 2012 5:44 pm    Post subject: [RISOLTO] Bridge networking su reti differenti Reply with quote

Ciao a tutti,
sto impazzendo da due settimane con una configurazione di rete mal funzionante e spero che mi possiate dare una mano a capire dove ho fatto l'errore.

Ho un server con due schede di rete eth0 e eth1, per tenere il traffico della rete interna separato da quello internet ho configurato sulla interfaccia eth0 l'indirizzo 192.168.100.2 (rete interna), mentre sulla eth1 ho configurato il bridge con l'interfaccia veth800.1 creata da un VPS openvz a cui è assegnato l'ip dinamicamente dal router del mio provider.

Output ifconfig CT0
Code:


eth0      Link encap:Ethernet  HWaddr 00:09:6b:f1:83:78 
          inet addr:192.168.100.2  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::209:6bff:fef1:8378/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16481 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14690 errors:0 dropped:0 overruns:0 carrier:0
          collisions:19 txqueuelen:100
          RX bytes:1586239 (1.5 MiB)  TX bytes:2258658 (2.1 MiB)

eth1      Link encap:Ethernet  HWaddr 00:09:6b:f1:83:79 
          inet6 addr: fe80::209:6bff:fef1:8379/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:25376 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4530 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:7081004 (6.7 MiB)  TX bytes:248992 (243.1 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1051 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1051 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:71202 (69.5 KiB)  TX bytes:71202 (69.5 KiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0
          TX packets:161 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:18559 (18.1 KiB)  TX bytes:19132 (18.6 KiB)

veth800.1 Link encap:Ethernet  HWaddr 00:09:6b:f1:83:83 
          inet6 addr: fe80::209:6bff:fef1:8383/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:196 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3678 errors:0 dropped:18 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8761 (8.5 KiB)  TX bytes:966771 (944.1 KiB)

vzbr1     Link encap:Ethernet  HWaddr 00:09:6b:f1:83:81 
          inet addr:192.168.1.131  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::209:6bff:fef1:8379/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3562 errors:0 dropped:0 overruns:0 frame:0
          TX packets:254 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:964812 (942.1 KiB)  TX bytes:13014 (12.7 KiB)


Output brctl
Code:

bridge name   bridge id      STP enabled   interfaces
vzbr1      8000.00096bf18381   no      eth1
                                     veth800.1


Nel VPS ho configurato due interfacce di rete venet0 con indirizzo statico 192.168.100.10, per essere visibile nella rete interna, e eth1 con indirizzo ip assegnato dinamicamente dal router del mio provider

Output ifconfig VPS
Code:

eth1      Link encap:Ethernet  HWaddr 00:18:51:a6:14:22 
          inet addr:192.168.1.133  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::218:51ff:fea6:1422/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4151 errors:0 dropped:0 overruns:0 frame:0
          TX packets:221 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1091792 (1.0 MiB)  TX bytes:9798 (9.5 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:192.168.100.10  P-t-P:192.168.100.10  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:173 errors:0 dropped:0 overruns:0 frame:0
          TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:20276 (19.8 KiB)  TX bytes:20359 (19.8 KiB)


visto così sembra tutto funzionante, ed effettivamente testando le due macchine con il ping, sia CT0 sia VPS sono raggiungibili
Code:

ping -c4 192.168.100.2
PING 192.168.100.2 (192.168.100.2) 56(84) bytes of data.
64 bytes from 192.168.100.2: icmp_req=1 ttl=64 time=1.03 ms
64 bytes from 192.168.100.2: icmp_req=2 ttl=64 time=1.17 ms
64 bytes from 192.168.100.2: icmp_req=3 ttl=64 time=17.9 ms
64 bytes from 192.168.100.2: icmp_req=4 ttl=64 time=41.0 ms

--- 192.168.100.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 1.032/15.288/41.001/16.360 ms


Code:

ping -c4 192.168.100.10
PING 192.168.100.10 (192.168.100.10) 56(84) bytes of data.
64 bytes from 192.168.100.10: icmp_req=1 ttl=64 time=1.02 ms
64 bytes from 192.168.100.10: icmp_req=2 ttl=64 time=1.14 ms
64 bytes from 192.168.100.10: icmp_req=3 ttl=64 time=1.18 ms
64 bytes from 192.168.100.10: icmp_req=4 ttl=64 time=0.955 ms

--- 192.168.100.10 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 0.955/1.075/1.182/0.090 ms


Se però testo le porte 25 e 8080 da internet, anche se ho abilitato il port forwarding sul router del mio provider, il test fallisce; me se a questo punto stoppo l'interfaccia vnet0 del VPS e rieseguo il test, tutto funziona a meraviglia.

Sono certo che ho fatto qualche stupidata nella configurazione, ma ho ricontrollato tutto almeno trenta volte e non riesco a venirne a capo.

Ogni idea per correggere il problema o suggerimento per una configurazione migliore di quella che ho realizzato è la ben accetta
_________________
Tacta taesticula fugant omnia pericula


Last edited by medknight on Sun Jan 08, 2012 2:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
medknight
n00b
n00b


Joined: 10 Mar 2007
Posts: 20

PostPosted: Sun Jan 08, 2012 2:34 pm    Post subject: Reply with quote

Eccomi di nuovo,
ho apportato alcune modifiche alla configurazione che vi ho postato, la più importante delle quali è l'aggiunta di un nuovo bridge, vzbr0

Code:

eth0      Link encap:Ethernet  HWaddr 00:09:6b:f1:83:78 
          inet6 addr: fe80::209:6bff:fef1:8378/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:1001404 errors:0 dropped:0 overruns:0 frame:0
          TX packets:147152 errors:0 dropped:0 overruns:0 carrier:0
          collisions:18091 txqueuelen:100
          RX bytes:462314202 (440.8 MiB)  TX bytes:30124074 (28.7 MiB)

eth1      Link encap:Ethernet  HWaddr 00:09:6b:f1:83:79 
          inet6 addr: fe80::209:6bff:fef1:8379/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:146791 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25895 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:45290590 (43.1 MiB)  TX bytes:3208544 (3.0 MiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:89819 errors:0 dropped:0 overruns:0 frame:0
          TX packets:89819 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8659228 (8.2 MiB)  TX bytes:8659228 (8.2 MiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

veth800.0 Link encap:Ethernet  HWaddr 00:09:6b:f1:83:82 
          inet6 addr: fe80::209:6bff:fef1:8382/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:44248 errors:0 dropped:0 overruns:0 frame:0
          TX packets:81279 errors:0 dropped:2103 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5061106 (4.8 MiB)  TX bytes:41668593 (39.7 MiB)

veth800.1 Link encap:Ethernet  HWaddr 00:09:6b:f1:83:83 
          inet6 addr: fe80::209:6bff:fef1:8383/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:10208 errors:0 dropped:0 overruns:0 frame:0
          TX packets:142103 errors:0 dropped:120 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2321170 (2.2 MiB)  TX bytes:40885872 (38.9 MiB)

vzbr0     Link encap:Ethernet  HWaddr 00:09:6b:f1:83:78 
          inet addr:192.168.100.2  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::209:6bff:fef1:8378/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:137729 errors:0 dropped:0 overruns:0 frame:0
          TX packets:123236 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:23328021 (22.2 MiB)  TX bytes:27191155 (25.9 MiB)

vzbr1     Link encap:Ethernet  HWaddr 00:09:6b:f1:83:79 
          inet addr:192.168.1.131  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::209:6bff:fef1:8379/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:135116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10043 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:40564422 (38.6 MiB)  TX bytes:454606 (443.9 KiB)


tra la scheda ethernet eth0 e la scheda virtuale veth800.0 creata da openvz.
Code:

bridge name   bridge id      STP enabled   interfaces
vzbr0      8000.00096bf18378   no      eth0
                                     veth800.0
vzbr1      8000.00096bf18379   no      eth1
                                     veth800.1


Inoltre, come potete vedere dall'output di ifconfig, ora i MAC Address dei due bridge, vzbr0 e vzbr1, corrispondono ai MAC delle schede ethernet, rispettivamente eth0 ed eth1.

Non sono assolutamente certo se e quale delle due modifiche apportate sia stata risolutiva per il mio problema, ma sta di fatto che finalmente tutto funzionare perfettamente.

Se qualcuno ne sa qualcosa in più sarei ben lieto di sentire la sua opinione in merito o avere link a documentazione più approfondita di quella che ho trovato fin ora.
_________________
Tacta taesticula fugant omnia pericula
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum