[+] Vlany - co robi

Masz problemy z siecią bądź internetem? Zapytaj tu
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2341
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

[+] Vlany - co robię źle?

Post autor: LordRuthwen »

Witam.
Próbuję skonfigurować vlany wg tego opisu, skonfigurowałem, lecz coś nie działa, próbuję puścić ping z maszyny podpiętej do tego samego przełącznika do portu 2, 3, 4 lub 24, i jedyna informacja jaką mam:

Kod: Zaznacz cały

Upłynął limit czasu żądania.
Ma ktoś jakieś pomysły na to? Bo jak dla mnie to powinno działać.
Tak to wygląda po stronie maszyny, do której pinguję:

Kod: Zaznacz cały

# cat /proc/net/vlan/config
VLAN Dev name    | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth0.10        | 10  | eth0
eth0.66        | 66  | eth0

Kod: Zaznacz cały

# cat /etc/network/interfaces
auto lo
iface lo inet loopback

allow-hotplug eth1
iface eth1 inet static

# vlan
auto eth0.10
iface eth0.10 inet static
        address 192.168.115.1
        netmask 255.255.255.0
        network 192.168.115.0
        broadcast 192.168.115.255
        mtu 1500
        vlan_raw_device eth0
#
auto eth0.66
iface eth0.66 inet static
        address 192.168.66.254
        netmask 255.255.255.0
        network 192.168.66.0
        broadcast 192.168.66.255
        mtu 1500
        vlan_raw_device eth0

Kod: Zaznacz cały

# ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:0d:61:80:e2:93 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
4: eth0.10@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN
    link/ether 00:0d:61:80:e2:93 brd ff:ff:ff:ff:ff:ff
    inet 192.168.115.1/24 brd 192.168.115.255 scope global eth0.10
5: eth0.66@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN
    link/ether 00:0d:61:80:e2:93 brd ff:ff:ff:ff:ff:ff
    inet 192.168.66.254/24 brd 192.168.66.255 scope global eth0.66

Kod: Zaznacz cały

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Natomiast tak po stronie switcha (cisco 2950):

Kod: Zaznacz cały

Current configuration:
!
version 12.0
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW1
!
enable secret hash :P
!
username admin
!
!
!
!
!
ip subnet-zero
cluster enable trata 0
!
!
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 1,10,66,1002-1005
 switchport mode trunk
 spanning-tree portfast
!
interface FastEthernet0/2
 switchport access vlan 66
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 10
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 10
 spanning-tree portfast
!
interface FastEthernet0/24
 description Zarzadzanie
 switchport access vlan 66
 spanning-tree portfast
!
interface VLAN1
 no ip directed-broadcast
 ip nat outside
 shutdown
!
interface VLAN66
 description Zarzadzanie
 ip address 192.168.66.1 255.255.255.0
 no ip directed-broadcast
 ip nat outside
!
ip nat inside source list 199 interface VLAN66 overload
access-list 199 dynamic Cluster-NAT permit ip any any
!
line con 0
 transport input none
 stopbits 1
line vty 0 4
 password haslo
 login
line vty 5 15
 password haslo
 login
!
end
Co ciekawe:

Kod: Zaznacz cały

# mii-tool
eth0: no link
eth1: negotiated 100baseTx-FD, link ok
Karta na 100% sprawna, połączenie fizycznie istnieje, przełącznik połączenie widzi.
Awatar użytkownika
markossx
Beginner
Posty: 489
Rejestracja: 26 maja 2007, 16:01
Lokalizacja: Polska

Post autor: markossx »

Pokaż tablice routingu...
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2341
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

Post autor: LordRuthwen »

Proszę:

Kod: Zaznacz cały

ip route sh
217.117.xxx.xxx/28 dev eth1  proto kernel  scope link  src 217.117.xxx.xxx
192.168.66.0/24 dev eth0.66  proto kernel  scope link  src 192.168.66.254
192.168.115.0/24 dev eth0.10  proto kernel  scope link  src 192.168.115.1
default via 217.117.xxx.xxx dev eth1

Kod: Zaznacz cały

route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
217.117.xxx.xxx  0.0.0.0         255.255.255.240 U     0      0        0 eth1
192.168.66.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0.66
192.168.115.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0.10
0.0.0.0         217.117.xxx.xxx  0.0.0.0         UG    0      0        0 eth1
Awatar użytkownika
markossx
Beginner
Posty: 489
Rejestracja: 26 maja 2007, 16:01
Lokalizacja: Polska

Post autor: markossx »

Routing wygląda ok.
Dlaczego tu jest

Kod: Zaznacz cały

interface VLAN1
 no ip directed-broadcast
 ip nat outside
[B][color=Red] shutdown[/color][/B]
?
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2341
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

Post autor: LordRuthwen »

Dobre pytanie, bo nie reaguje na to co mu piszę (no sh).
Wywaliłem tą ACL-kę co tam była i nat, bo chcę uzyskać tylko komunikację pomiędzy serwerem linuksa stojącym na końcu (a w zasadzie początku: Fa0/1) a maszynami podpiętymi do portów Fa0/2-23

Kod: Zaznacz cały

Current configuration:
!
version 12.0
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW1
!
enable secret 5 hash :P
!
username admin
!
!
!
!
!
ip subnet-zero
cluster enable trata 0
!
!
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 1,10,66,1002-1005
 switchport mode trunk
 spanning-tree portfast
!
interface FastEthernet0/2
 switchport access vlan 66
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 10
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 10
 spanning-tree portfast
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
 description Zarzadzanie
 switchport access vlan 66
 spanning-tree portfast
!
interface VLAN1
 no ip directed-broadcast
 shutdown
!
interface VLAN66
 description Zarzadzanie
 ip address 192.168.66.1 255.255.255.0
 no ip directed-broadcast
!
line con 0
 transport input none
 stopbits 1
line vty 0 4
 password haslo
 login
line vty 5 15
 password haslo
 login
!
end
I żeby nie było że farmazony piszę z tym, że Cisco połączenie widzi:

Kod: Zaznacz cały

FastEthernet0/1 is up, line protocol is up
  Hardware is Fast Ethernet, address is 0002.b994.5bc1 (bia 0002.b994.5bc1)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive not set
  Auto-duplex (Full), Auto Speed (100), 100BaseTX/FX
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Queueing strategy: fifo
  Output queue 0/40, 0 drops; input queue 0/75, 0 drops
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 62000 bits/sec, 65 packets/sec
     1 packets input, 64 bytes
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast
     0 input packets with dribble condition detected
     3822813 packets output, 515799393 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
Awatar użytkownika
markossx
Beginner
Posty: 489
Rejestracja: 26 maja 2007, 16:01
Lokalizacja: Polska

Post autor: markossx »

Nie mam teraz jak sprawdzić ale z tego co pamiętam to ,,shutdown'' wykona się jak jest interfejs skonfigurowany.

Kod: Zaznacz cały

interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 1,10,66,1002-1005
 switchport mode trunk
 spanning-tree portfast
Karta w Linuksie obsługuje 802.1Q?

Spróbuj na porcie gdzie masz podpięty ten ruter:

Kod: Zaznacz cały

switchport mode multi 
switchport multi vlan X Y
W ten sposób odseparujesz vlany bez dot1q...
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2341
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

Post autor: LordRuthwen »

Nic z tego, efekt taki sam, a dotq obsługuje moduł 8021q.
Awatar użytkownika
markossx
Beginner
Posty: 489
Rejestracja: 26 maja 2007, 16:01
Lokalizacja: Polska

Post autor: markossx »

Przykro mi więc, nie mam teraz niestety czasu analizować Twoich konfigów ponownie a pomysły mi się wyczerpały.
Gdybyś znalazł rozwiązanie zanim ja zerknę do konfigów daj proszę znać.

Pozdrawiam :)
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2341
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

Post autor: LordRuthwen »

Właśnie problem w tym, ze mi też się już pomysły skończyły, dlatego napisałem na forum.

Ma ktoś jeszcze jakieś sugestie co do możliwego rozwiązania problemu?
sethiel
Junior Member
Posty: 762
Rejestracja: 28 stycznia 2008, 11:50
Lokalizacja: Wrocław

Post autor: sethiel »

Pytanie:
Co masz gdzie wpięte?
Do FE0/1 powinieneś mieć wpięte urządzenie (komputer) z vlanami, czyli eth0.10, eth0.66.
Do FE0/2 powinieneś mieć wpięte urządzenie bez vlanow, czyli eth0.
Może to pomoże.

Na początku bym zrobił tak, a potem zmieniał:
przełącznik

Kod: Zaznacz cały

!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/2
 switchport access vlan 66
 spanning-tree portfast
!
interface VLAN66
 ip address 192.168.66.1 255.255.255.0
 no ip directed-broadcast
 no ip route-cache
!
Urządzenie podpięte do FE0/1:

Kod: Zaznacz cały

auto eth0.66
iface eth0.66 inet static
    address 192.168.66.254
    netmask 255.255.255.0
    network 192.168.66.0
    broadcast 192.168.66.255
Urządzenie podpięte do FE0/2:

Kod: Zaznacz cały

auto eth0
iface eth0 inet static
    address 192.168.66.100
    netmask 255.255.255.0
    network 192.168.66.0
    broadcast 192.168.66.255
ODPOWIEDZ