Advertisement
Guest User

NETWORK + 3G

a guest
Feb 18th, 2018
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 89.77 KB | None | 0 0
  1.  
  2. ##########################################################
  3. ##### NETWORK ####
  4. ##########################################################
  5.  
  6.  
  7. Konfigurowanie interfejsu Ethernet
  8. Przewidywalne nazwy interfejsów sieciowych
  9. Używanie DHCP do automatycznego konfigurowania interfejsu
  10. Ręczne konfigurowanie interfejsu
  11. Ustawianie prędkości i dupleksu
  12. Interfejs bez adresu IP
  13. Definiowanie serwerów nazw (DNS)
  14. Plik konfiguracyjny resolv.conf
  15. Program resolvconf
  16. Konfiguracja DNS dla menedżera sieci
  17. Konfiguracja klienta DHCP
  18. Bridging
  19. Mostkowanie bez przełączania
  20. Howto use vlan (dot1q, 802.1q, trunk) (Etch, Lenny)
  21. Konfiguracja ręczna
  22. Konfiguracja skryptu sieciowego
  23. Mosty i sieci VLAN
  24. Zastrzega się przy stosowaniu mostkowania i vlan
  25. Jak stworzyć odporne na uszkodzenia wiązania z vlan (Etch)
  26. Konfiguracja sieci
  27. klejenie z aktywną kopią zapasową
  28. / etc / network / interfaces
  29. Jak ustawić MTU (Max transfer unit / packet size) za pomocą VLANS nad połączonym interfejsem
  30. Wiele adresów IP w jednym interfejsie
  31. Stara metoda
  32. Metoda iproute2
  33.  
  34. Konfigurowanie interfejsu Ethernet
  35.  
  36. Większość konfiguracji sieci można wykonać za pomocą pliku konfiguracyjnego interfejsów w / etc / network / interfaces . Tutaj możesz podać swojej karcie sieciowej adres IP (lub użyć dhcp), skonfigurować informacje o routingu, skonfigurować maskowanie IP, ustawić domyślne trasy i wiele więcej.
  37.  
  38. Pamiętaj, aby dodać interfejsy, które mają zostać podniesione przy starcie systemu do linii "auto".
  39.  
  40. Zobacz interfejsy człowiek, aby uzyskać więcej opcji.
  41.  
  42. Przewidywalne nazwy interfejsów sieciowych
  43.  
  44. Od wersji Stretch stare nazwy sieci, takie jak eth0, eth1, zniknęły, ponieważ nazwa urządzenia może się zmienić. Nowe nazwy są podobne do tych: enp6s0, enp8s0, enp0s31f6, enp5s0. Niestety, wykorzystywany system nadal jest nieco arbitralny, ponieważ opiera się na wyliczeniach BIOS-u, które zmieniają się w błędne BIOS-y i w niektórych sytuacjach. (To nie było oparte na zmniejszonej sumie sumy adresu MAC (2c: 56: ac: 39: ec: 0d staje się 98) lub inna podobna metoda jest zagadkowa (udev może robić takie rzeczy) i nazwy, które nam pozostały są raczej nieprzyjazne dla użytkownika).
  45.  
  46. Dla osób korzystających z więcej niż jednego interfejsu sieciowego - będziemy musieli poradzić sobie z nowym systemem.
  47.  
  48. Aby znaleźć nazwy interfejsów, zajrzyj tutaj: $ ls / sys / class / net /
  49.  
  50. Aktualizowanie i przewidywanie nazw interfejsów sieciowych
  51.  
  52. Uaktualnienia do wersji Stretch zachowują stare nazwy urządzeń - pomimo tego, co przeczytasz w Internecie - usunięcie /etc/udev/rules.d/70-local-persistent-net.rules nie da ci nowych nazw nawet po update-initramfs -u i update-grub. (jeszcze nie znalazłem poprawnych inkantacji Debiana?)
  53.  
  54. Używanie DHCP do automatycznego konfigurowania interfejsu
  55.  
  56. Jeśli używasz tylko protokołu DHCP, wszystko, czego potrzebujesz, to coś takiego:
  57.  
  58. auto eth0
  59. allow-hotplug eth0
  60. iface eth0 inet dhcp
  61.  
  62. W przypadku protokołu DHCPv6 (używanego do IPv6) dołącz także następującą sekcję iface
  63.  
  64. iface eth0 inet6 dhcp
  65.  
  66. Alternatywnie, protokół IPv6 może być automatycznie konfigurowany za pomocą automatycznej konfiguracji adresu bezstanowego lub SLAAC, który jest określony za pomocą funkcji auto zamiast dhcp w sekcji inet6 :
  67.  
  68. iface eth0 inet6 auto
  69.  
  70. Ręczne konfigurowanie interfejsu
  71.  
  72. Jeśli konfigurujesz go ręcznie, wówczas coś takiego ustawi domyślną bramę (sieć, transmisja i brama są opcjonalne):
  73.  
  74. auto eth0
  75. iface eth0 inet static
  76. adres 192.0.2.7
  77. maska ​​sieci 255.255.255.0
  78. bramka 192.0.2.254
  79.  
  80. Jeśli chcesz dodać również adres IPv6, dodaj coś takiego:
  81.  
  82. iface eth0 inet6 static
  83. adres 2001: db8 :: c0ca: 1eaf
  84. maska ​​sieci 64
  85. gateway 2001: db8 :: 1ead: ed: beef
  86.  
  87. Zobacz interfejsy człowiek, aby uzyskać więcej opcji.
  88.  
  89. Wyłącz wszystkie usługi DHCP, np. Dhcpcd .
  90.  
  91. Ustawianie prędkości i dupleksu
  92.  
  93. Automatyczna negocjacja wielokrotnie kończy się niepowodzeniem i często jest oznaką wadliwego okablowania, dlatego należy zbadać sprawy fizyczne, zanim uznają, że algorytmy autonegocjacji interfejsów są niezgodne. Jeśli wyłączysz automatyczną negocjację i ręcznie ustawisz szybkość i dupleks, interfejs partnera na drugim końcu kabla będzie zakładał, że brak automatycznej negocjacji wskazuje prędkość 10 Mb / s i dupleks połowy. Aby zapewnić bezbłędną pracę, jeśli ręcznie ustawisz prędkość i dupleks, musisz upewnić się, że dokładnie taka sama prędkość i dupleks są skonfigurowane w interfejsie partnera.
  94.  
  95. Jeśli ustawisz prędkość i dupleks interfejsu ręcznie, może być wymagana próba i błąd. Oto podstawowe kroki:
  96.  
  97. Zainstaluj pakiety ethtool i net-tools , aby mieć programy ettool i mii-tool . Jeden lub oba mogą działać dla twojego interfejsu.
  98.  
  99. Upewnij się, że masz możliwość zalogowania się do systemu na wypadek, gdyby interfejs sieciowy stał się niefunkcjonalny. Połączenie SSH może zostać zakłócone, więc powinieneś mieć strategię awaryjną.
  100. Zidentyfikuj interfejs, o którym mowa (często będzie to eth0). Odpowiednio dostosuj pozostałą część instrukcji.
  101. Spróbuj określić, jakie są obecne ustawienia prędkości i dupleksu. W tym momencie robi się fajnie:
  102.  
  103. Jako root, spróbuj najpierw ethtool eth0 i sprawdź, czy linie "Speed:" i "Duplex:" wyglądają poprawnie. W przeciwnym razie etykieta może nie być obsługiwana przez Twoje urządzenie.
  104.  
  105. Jako root, wypróbuj mii-tool -v eth0 i zobacz, czy jego wyjście wygląda poprawnie. Jeśli nie, to Mii-narzędzie może nie być obsługiwane przez twoje urządzenie.
  106.  
  107. Jeśli żaden z nich nie jest obsługiwany, może być konieczne ustawienie parametrów bezpośrednio w module sterownika jądra. Zidentyfikuj moduł sterownika, którego używasz, czytając dane wyjściowe dmesg i lsmod . Następnie możesz wypróbować modinfo MODULENAME, aby zobaczyć, jakie parametry zaakceptuje, jeśli takie istnieją. (Możesz użyć modinfo nawet w modułach, które nie są załadowane, dla porównania.) ToDo : gdzie ustawia się parametry modułu jądra?
  108. Następnie spróbuj zmienić ustawienia interfejsu podczas jego działania. Oczywiście musisz być rootem. Zarówno:
  109.  
  110. ethtool -s eth0 speed 100 duplex full autoneg off (zakładając 100 Mbps i pełny dupleks)
  111.  
  112. mii-tool -F 100baseTx-FD eth0 (samo założenie)
  113. W każdym przypadku sprawdź ponownie, czy ustawienia interfejsu rzeczywiście się zmieniły, a następnie spróbuj wysłać niektóre dane do systemu i wyjść z niego, aby sprawdzić, czy karta sieciowa działa poprawnie.
  114.  
  115. Jeśli jedno z tych poleceń z powodzeniem ustawi twoją kartę sieciową, możesz umieścić ją w / etc / network / interfaces, aby działała po podniesieniu interfejsu (np. Przy starcie systemu). Jednak zanim to zrobisz, powinieneś zrozumieć, że niektóre sterowniki i urządzenia zachowują się inaczej niż inne. Po załadowaniu modułu sterownika karta sieciowa może rozpocząć autonegocjację bez żadnej możliwości jej zatrzymania (szczególnie w przypadku sterowników, które nie akceptują parametrów). Ustawienia z interfejsów są stosowane w pewnym momencie, które mogą znajdować się w samym środku negocjacji. Niektórzy uważają więc za konieczne opóźnienie polecenia ethtool lub mii-tool o kilka sekund. A zatem:
  116.  
  117. iface eth0 inet static
  118. adres ...
  119. maska ​​sieci ...
  120. brama ...
  121. spać 5; ethtool -s eth0 ...
  122.  
  123. Lub analogiczne polecenie mii-tool .
  124. Zrestartuj komputer, aby upewnić się, że poprawnie wyświetlił się, i bądź gotowy do interwencji ręcznie (np. Ctrl-Alt-Del, a następnie uruchom tryb pojedynczego użytkownika z GRUB lub LILO), jeśli coś nie działa.
  125.  
  126. Interfejs bez adresu IP
  127.  
  128. Aby utworzyć interfejs sieciowy bez adresu IP, użyj metody ręcznej i użyj komend wstępnych i końcowych, aby zwiększyć lub zmniejszyć interfejs.
  129.  
  130. iface eth0 inet manual
  131. pre-up ifconfig $ IFACE up
  132. post-down ifconfig $ IFACE w dół
  133.  
  134. Jeśli interfejs jest interfejsem VLAN, polecenia góra / dół muszą być wykonywane po / przed haczykami vlan. (Musisz także zainstalować pakiet vlan .)
  135.  
  136. iface eth0.99 inet manual
  137. post-up ifconfig $ IFACE up
  138. pre-down ifconfig $ IFACE w dół
  139.  
  140. Uwaga: Jeśli tworzysz interfejs VLAN tylko po to, aby umieścić go w moście, nie ma potrzeby ręcznego definiowania interfejsu VLAN. Po prostu skonfiguruj most, a interfejs VLAN zostanie utworzony automatycznie podczas tworzenia mostu (patrz poniżej).
  141.  
  142. Definiowanie serwerów nazw (DNS)
  143.  
  144. Zanim komputer może połączyć się z zewnętrznym zasobem sieciowym (na przykład z serwerem WWW), musi mieć możliwość konwersji dowolnych nazw alfanumerycznych (np. Wiki.debian.org) na numeryczne adresy sieciowe (np. 140.211.166.4 ). (Internet używa tych strukturalnych numerycznych adresów IP jako adresów sieciowych.)
  145.  
  146. Biblioteka C i inne biblioteki tłumaczeń szukają pliku /etc/resolv.conf dla listy serwerów nazw. W najprostszym przypadku jest to plik do edycji, aby ustawić listę serwerów nazw. Ale pamiętaj, że różne inne programy do dynamicznej konfiguracji z przyjemnością nadpisają twoje ustawienia:
  147.  
  148. Program resolvconf
  149.  
  150. Demon menedżera sieci
  151. Klienci DHCP
  152.  
  153. W większości sytuacji plik do edycji jest plikiem konfiguracyjnym dla takiego programu.
  154.  
  155. W najbardziej złożonych sytuacjach używanie resolvconf jest na prawdę właściwą drogą, chociaż w bardziej prostych konfiguracjach prawdopodobnie jest to przesada.
  156.  
  157. Plik konfiguracyjny resolv.conf
  158.  
  159. Plik konfiguracyjny resolv.conf w pliku /etc/resolv.conf zawiera informacje umożliwiające komputerowi podłączonemu do sieci rozpoznawanie nazw na adresy. (Uwaga: nie mylić tego pliku konfiguracyjnego z programem resolvconf , który niestety ma prawie identyczną nazwę).
  160.  
  161. Plik resolv.conf zwykle zawiera adresy IP serwerów nazw (DNS resolveers), które będą próbowały tłumaczyć nazwy na adresy dla dowolnego węzła dostępnego w sieci. Pojawi się linia lub linie, które wyglądają tak:
  162.  
  163. serwer nazw 12.34.56.78
  164. serwer nazw 12.34.56.79
  165.  
  166. W tym przykładzie system używa serwerów nazw na adresach IP 12.34.56.78 i 12.34.56.79 . Po prostu edytuj plik i wprowadź adresy IP serwerów nazw, których musisz używać po każdym serwerze nazw . Dodaj więcej linii serwerów nazw , jeśli masz więcej serwerów nazw. Nie używaj tej metody, jeśli masz zainstalowany program resolvconf .
  167.  
  168. Plik konfiguracyjny resolv.conf ma wiele innych opcji definiujących sposób wyszukiwania nazw przez repozytorium. Zobacz szczegóły man resolv.conf .
  169.  
  170. Program resolvconf
  171.  
  172. Program resolvconf śledzi informacje systemowe o aktualnie dostępnych serwerach nazw. Nie należy go mylić z plikiem konfiguracyjnym resolv.conf , który niestety ma prawie identyczną nazwę. Program resolvconf jest opcjonalny w systemie Debian.
  173.  
  174. Plik konfiguracyjny resolv.conf zawiera informacje o serwerach nazw używanych przez system. Jednakże, gdy wiele programów musi dynamicznie modyfikować plik konfiguracyjny resolv.conf , mogą się ze sobą nawzajem łączyć i plik może stać się niesynchronizowany. Program resolvconf rozwiązuje ten problem. Działa jako pośrednik między programami, które dostarczają informacje o serwerze nazw (np. Klienci dhcp) i programami, które używają informacji o serwerze nazw (np. Resolver).
  175.  
  176. Kiedy resolvconf jest poprawnie zainstalowany, plik konfiguracyjny resolv.conf w /etc/resolv.conf jest zamieniany przez dowiązanie symboliczne do /etc/resolvconf/run/resolv.conf, a zamiast tego resolver używa pliku konfiguracyjnego, który jest dynamicznie generowany przez resolvconf w /etc/resolvconf/run/resolv.conf .
  177.  
  178. Program resolvconf jest zwykle potrzebny tylko wtedy, gdy system ma wiele programów, które muszą dynamicznie modyfikować informacje o serwerze nazw. W prostym systemie, w którym serwery nazw nie zmieniają się często lub są zmieniane tylko przez jeden program, plik konfiguracyjny resolv.conf jest odpowiedni.
  179.  
  180. Jeśli zainstalowany jest program resolvconf , nie należy edytować pliku konfiguracyjnego resolv.conf ręcznie, ponieważ zostanie on dynamicznie zmieniony przez programy w systemie. Jeśli chcesz ręcznie zdefiniować serwery nazw (tak jak w przypadku interfejsu statycznego), dodaj linię podobną do następującej w pliku konfiguracyjnym interfejsów w / etc / network / interfaces :
  181.  
  182. dns-nameservers 12.34.56.78 12.34.56.79
  183.  
  184. Umieść linię wciętą wewnątrz zwrotki iface , np. Tuż za linią bramy . Wprowadź adresy IP serwerów nazw, których musisz użyć po dns-nameservers . Umieść wszystkie w jednej linii oddzielonej spacjami. Nie zapomnij o " s " na końcu dns-nameservers .
  185.  
  186. Program resolvconf jest całkiem nowym dodatkiem do Debiana i wiele starszych programów wymaga aktualizacji lub rekonfiguracji, aby działały poprawnie. Jeśli masz problemy, zobacz / usr / share / doc / resolvconf / README . Zawiera mnóstwo informacji o tym, jak inne programy radzą sobie z resolvconf .
  187.  
  188. Konfiguracja DNS dla menedżera sieci
  189.  
  190. Menedżer sieci zastąpi ustawienia dhcp, zastępując resolv.conf, nawet jeśli skonfigurowałeś DNS w pliku /etc/dhcp/dhclient.conf, np. Powodując, że DNS najpierw przeszukuje domenę lokalną, co może wymagać czasu przed rozpoznaniem DNS, co powoduje długotrwałe DNS czasy rozwiązania. Możesz zorientować się, co NetworkManager uważa za ustawienia, wykonując polecenie nm-tool z linii poleceń.
  191.  
  192. Możesz skonfigurować te ustawienia za pomocą graficznego interfejsu użytkownika, uruchamiając edytor połączeń nm, którego aktualnie (13.11.23) nie można znaleźć w Narzędziach systemowych → Administracja, ale należy go uruchomić ręcznie z wiersza poleceń. Po uruchomieniu:
  193.  
  194. Wybierz połączenie (na karcie Wired lub Wireless) i kliknij Edytuj.
  195. Kliknij kartę Ustawienia IPv4
  196. Wybierz "Tylko adresy automatyczne (DHCP)" zamiast "Automatyczny (DHCP)".
  197. Wprowadź serwery DNS w polu "Serwery DNS", oddzielone spacjami (np. 208.67.222.222 dla OpenDNS).
  198. Kliknij "Zastosuj".
  199.  
  200. NetworkManager zapisuje te ustawienia w / etc / NetworkManager / system-connections / name-of-connection . Przykład / etc / NetworkManager / system-connections / Wired connection 1 :
  201.  
  202. [802-3-ethernet]
  203. duplex = pełny
  204. mac-address = XX: XX: XX: XX: XX: XX
  205.  
  206. [połączenie]
  207. id = Połączenie przewodowe 1
  208. uuid = xxx-xxxxxx-xxxxxx-xxxxxx-xxx
  209. type = 802-3-ethernet
  210. timestamp = 1385213042
  211.  
  212. [ipv6]
  213. method = auto
  214.  
  215. [ipv4]
  216. method = auto
  217. dns = 208,67.222.222;
  218. ignore-auto-dns = true
  219.  
  220. Ponowne uruchomienie narzędzia nm powinno pokazać, że NetworkManager ma teraz pojęcie, jak należy rozwiązać twój DNS.
  221.  
  222. Konfiguracja klienta DHCP
  223.  
  224. Przykład: dhclient3 używa /etc/dhcp/dhclient.conf . Ustawienie, które chcesz
  225.  
  226. zastępuje nazwy domen-serwery 12.34.56.78, 12.34.56.79;
  227.  
  228. lub może
  229.  
  230. prepend nazwa-domeny-serwery 12.34.56.78, 12.34.56.79;
  231.  
  232. Szczegóły znajdziesz na stronie podręcznika dhclient.conf (5).
  233.  
  234. Bridging
  235.  
  236. Mostkowanie powoduje umieszczenie wielu interfejsów w tym samym segmencie sieci. Jest to bardzo popularne przy podłączaniu serwera do wielu przełączników w celu uzyskania wysokiej dostępności lub wirtualizacji. W tym ostatnim przypadku zwykle służy do utworzenia mostu na hoście (np. Dom0) i umieszczenia wirtualnych interfejsów gości (domU) w moście.
  237.  
  238. Przykład: Podłącz serwer do 2 przełączników (przez eth0 i eth1), definiując most 0 i nadaj serwerowi adres IP w tej podsieci:
  239.  
  240. auto br0
  241. iface br0 inet static
  242. adres 10.10.0.15
  243. maska ​​sieci 255.255.255.0
  244. bramka 10.10.0.1
  245. bridge_ports eth0 eth1
  246. w górę / usr / sbin / brctl stp br0 on
  247.  
  248. Jeśli serwer jest podłączony do wielu przełączników, zwykle trzeba uruchomić protokół drzewa opinającego, aby uniknąć pętli. Dlatego STP musi być włączony za pomocą polecenia "w górę", jak pokazano powyżej.
  249.  
  250. Przykład: Konfiguracja mostu bez konfiguracji adresu IP (użyj "manual" zamiast "static"), aby "przekazać dalej" interfejs do maszyny wirtualnej gościa. (Konfiguracja statycznego mostu zawiera tylko jeden interfejs fizyczny, interfejs wirtualny zostanie dodany do mostu po uruchomieniu maszyny wirtualnej).
  251.  
  252. auto br1
  253. Instrukcja iface br1 inet
  254. bridge_ports eth4
  255. up / usr / sbin / brctl setageing br1 0
  256. w górę / usr / sbin / brctl stp br0 off
  257.  
  258. Uwaga: Most linuxowy obsługuje tylko STP, bez RSTP (Rapid Spanning Tree). Dlatego obsługuje tylko stare koszty STP, a nie nowe koszty RSTP (patrz Spanning_Tree_Protocol ). Zazwyczaj jest to w porządku z przełącznikami Cisco, ale np. Przełączniki Juniper wykorzystują koszty RSTP, co może prowadzić do różnych obliczeń drzewa opinającego i problemów z pętlami. Można to naprawić, ustawiając koszty ręcznie, na przełączniku lub na serwerze. Ustawienie kosztu na przełączniku jest preferowane, ponieważ Linux przełącza się z powrotem na domyślne koszty za każdym razem, gdy interfejs zmniejsza / upuszcza.
  259.  
  260. Mostkowanie bez przełączania
  261.  
  262. Domyślnie most linuksowy działa jak przełącznik. Oznacza to, że zapamiętuje adresy MAC znajdujące się za portem przełącznika, a jeśli docelowy adres MAC jest znany, pakiety danych lub przesyłają tylko do odpowiedniego portu - w przeciwnym razie będą transmitowane pakiety.
  263.  
  264. W niektórych konfiguracjach jest to złe. Na przykład, jeśli most łączy 2 interfejsy magistrali i te same adresy MAC mogą być widoczne z obu interfejsów, w zależności od sieci VLAN. Ponieważ most linuxowy nie obsługuje VLAN (dedykowane tabele adresów MAC dla każdej sieci VLAN), w takich konfiguracjach należy wyłączyć uczenie się adresu MAC i przełączyć mostek w prawdziwy tryb "mostkowy" z:
  265.  
  266. up / sbin / brctl setageing br0 0
  267. up / sbin / brctl stp br0 off
  268.  
  269. Howto use vlan (dot1q, 802.1q, trunk) (Etch, Lenny)
  270.  
  271. Konfiguracja ręczna
  272.  
  273. modprobe 8021q
  274.  
  275. apt-get install vlan
  276.  
  277. vconfig add eth0 222 # 222 jest liczbą vlan
  278. ifconfig eth0.222 up
  279. ifconfig eth0.222 mtu 1496 #optional, jeśli twoja karta sieciowa nie obsługuje MTU 1504B
  280. ifconfig eth0.222 10.10.10.1 maska ​​sieci 255.255.255.0
  281.  
  282. Konfiguracja skryptu sieciowego
  283.  
  284. Do / etc / modules dodaj linię:
  285.  
  286. 8021q
  287.  
  288. W / etc / network / interfaces do section iface dodaj parametr:
  289.  
  290. v0l-raw-device eth0
  291.  
  292. Nazwa interfejsu powinna być nazwą surowego interfejsu (taką samą, jak określona przez urządzenie vlan-raw), a następnie kropką, a następnie identyfikatorem sieci VLAN, na przykład eth0.100. Zamiast tego może to być "vlan", a następnie VLAN ID, na przykład vlan100. W obu przypadkach identyfikator sieci VLAN jest na końcu i jest to jedyne miejsce, w którym jest skonfigurowany.
  293.  
  294. Uwaga: Jeśli nazwiesz interfejsy VLAN ethX.YYY, wówczas nie ma potrzeby określania urządzenia vlan-raw, ponieważ urządzenie surowe można pobrać z nazwy interfejsu.
  295.  
  296. Na przykład:
  297.  
  298. auto eth0.222
  299. iface eth0.222 inet static
  300. adres 10.10.10.1
  301. maska ​​sieci 255.255.255.0
  302. v0l-raw-device eth0
  303.  
  304. Mosty i sieci VLAN
  305.  
  306. Jeśli tworzysz interfejsy VLAN tylko w celu umieszczenia ich w moście, nie ma potrzeby ręcznego definiowania interfejsów VLAN. Po prostu skonfiguruj most, a interfejs VLAN zostanie utworzony automatycznie podczas tworzenia mostu, np .:
  307.  
  308. auto br1
  309. Instrukcja iface br1 inet
  310. bridge_ports eth0.99 eth1.99
  311. w górę / usr / sbin / brctl stp br0 on
  312.  
  313. Zastrzega się przy stosowaniu mostkowania i vlan
  314.  
  315. # / etc / network / interfaces
  316. auto eth0 bri0
  317. iface eth0 inet static
  318. adres 192.168.1.1
  319. maska ​​sieci 255.255.255.0
  320. iface eth0.110 inet manual
  321. v0l-raw-device eth0
  322. iface bri0 inet static
  323. adres 192.168.110.1
  324. maska ​​sieci 255.255.255.0
  325. bridge_ports eth0.110
  326. bridge_stp on
  327. bridge_maxwait 10
  328.  
  329. Jeśli używasz zaawansowanej konfiguracji sieci VLAN, która jest prawdopodobnie przydatna do pracy w sieci w środowiskach wirtualizacji, zadbaj o podłączenie urządzenia mostkowego lub sieci VLAN do fizycznego urządzenia bazowego - jak pokazano powyżej. Dołączenie interfejsu fizycznego (eth0) do mostka (np. Bri1) przy użyciu tego samego fizycznego interfejsu na pozornie różnych sieciach VLAN spowoduje, że wszystkie pakiety pozostaną oznakowane. (Kernel nowszy niż 2.6.37 i starszy niż 3.2).
  330.  
  331. Jak stworzyć odporne na uszkodzenia wiązania z vlan (Etch)
  332.  
  333. debian_bonding.png
  334.  
  335. debian_bonding.dia
  336.  
  337. Jak skonfigurować jedno z powyższych aktywnych połączeń na serwerze 3 vlan {vlan10, vlan20, vlan30} Sieć Debiana bez SPOF bez natywnego vlana.
  338.  
  339. aptitude install vlan ifenslave-2.6
  340.  
  341. Konfiguracja sieci
  342.  
  343. Przykład konfiguracji interfejsu przełącznika Cisco
  344.  
  345. interfejs GigabitEthernet1 / 2
  346. opis eth1
  347. switchport
  348. switchport trunk encapsulation dot1q
  349. switchport trunk dozwolone vlan 10,20,30
  350. bagażnik trybu switchport
  351. bez adresu IP
  352. brak włączania cdp
  353. spanning-tree portfast trunk
  354.  
  355. klejenie z aktywną kopią zapasową
  356.  
  357. Utwórz plik /etc/modprobe.d/bonding.conf zawierający:
  358.  
  359. alias bond0 bonding
  360. opcje tryb łączenia = aktywna kopia zapasowa miimon = 100 downdelay = 200 updelay = 200 primary = eth1
  361.  
  362. / etc / network / interfaces
  363.  
  364. # Interfejs sieciowy pętli zwrotnej
  365. auto lo
  366. iface lo inet loopback
  367. # Główny interfejs sieciowy
  368. auto bond0
  369. iface bond0 inet manual
  370. up ifconfig bond0 0.0.0.0 up
  371. niewolnicy eth1 eth0
  372. auto vlan10
  373. iface vlan10 inet static
  374. adres 10.10.10.12
  375. maska ​​sieci 255.255.0.0
  376. vlan-raw-device bond0
  377. bramka 10.10.0.1
  378. dns-search hup.hu
  379. dns-nameservers 10.10.0.2
  380. auto vlan20
  381. iface vlan20 inet static
  382. adres 10.20.10.12
  383. maska ​​sieci 255.255.0.0
  384. vlan-raw-device bond0
  385. auto vlan30
  386. iface vlan30 inet static
  387. adres 10.30.10.12
  388. maska ​​sieci 255.255.0.0
  389. vlan-raw-device bond0
  390.  
  391. Jak ustawić MTU (Max transfer unit / packet size) za pomocą VLANS nad połączonym interfejsem
  392.  
  393. MTU musi być skonfigurowany na interfejsie łączenia i interfejsach slave po zresetowaniu konfiguracji zastosowanej do interfejsów łączących. Odbywa się to za pomocą linii post-up w konfiguracji interfejsu klejenia.
  394.  
  395. auto bond0
  396. iface bond0 inet manual
  397. up ifconfig lacptrunk0 0.0.0.0 w górę
  398. niewolnicy eth0 eth1
  399. # bond-mode 4 = 802.3ad
  400. tryb bond 4
  401. bond-miimon 100
  402. bond-downdelay 200
  403. bond-updelay 200
  404. stopa lacp-bond 1
  405. bond-xmit-hash-policy layer2 + 3
  406. post-up ifconfig eth0 mtu 9000 && ifconfig eth1 mtu 9000 && ifconfig bond0 mtu 9000
  407.  
  408. Urządzenia #vlan będą używać zestawu MTU na urządzeniu bond0
  409. auto vlan101
  410. iface vlan101 inet static
  411.  
  412. adres 10.101.60.123
  413. maska ​​sieci 255.255.255.0
  414. bramka 10.155.60.1
  415. vlan-raw-device bond0
  416.  
  417. auto vlan151
  418. iface vlan151 inet static
  419.  
  420. adres 192.168.1.1
  421. maska ​​sieci 255.255.255.0
  422. vlan-raw-device bond0
  423.  
  424. Wiele adresów IP w jednym interfejsie
  425.  
  426. Aliasowanie interfejsu umożliwia posiadanie wielu interfejsów w jednym interfejsie. Jest to przydatne, gdy więcej niż jeden serwer ma być widoczny przez Internet. Należy zauważyć, że hosty wirtualne mogą obsługiwać wiele serwerów Apache z jednym adresem IP. Apache odpowiada na nazwę domeny dostarczoną przez klienta w nagłówku HTTP. W wielu innych sytuacjach jeden zewnętrzny adres IP jest potrzebny dla każdego serwera korzystającego z portu.
  427.  
  428. Stara metoda
  429.  
  430. Ten tekst / etc / network / interfaces przypisuje do eth0 trzy adresy IP.
  431.  
  432. auto eth0
  433. allow-hotplug eth0
  434. iface eth0 inet static
  435. adres 192.168.1.42
  436. maska ​​sieci 255.255.255.0
  437. bramka 192.168.1.1
  438.  
  439. auto eth0: 0
  440. allow-hotplug eth0: 0
  441. iface eth0: 0 inet static
  442. adres 192.168.1.43
  443. maska ​​sieci 255.255.255.0
  444.  
  445. auto eth0: 1
  446. allow-hotplug eth0: 1
  447. iface eth0: 1 inet static
  448. adres 192.168.1.44
  449. maska ​​sieci 255.255.255.0
  450.  
  451. Interfejs aliasu nie powinien mieć "gateway" ani "dns-nameservers"; Dynamiczne przydzielanie adresów IP jest dopuszczalne.
  452.  
  453. Powyższa konfiguracja jest poprzednią tradycyjną metodą, która odzwierciedla tradycyjne użycie ifconfig do konfigurowania urządzeń sieciowych. ifconfig wprowadził pojęcie interfejsów aliasowych lub wirtualnych . Te typy wirtualnych interfejsów mają nazwy interfejsu formularza : integer i ifconfig traktują je bardzo podobnie do rzeczywistych interfejsów.
  454.  
  455. Obecnie ifupdown używa narzędzia ip z pakietu iproute2 zamiast ifconfig . Nowsze narzędzie ip nie używa tej samej koncepcji aliasów ani wirtualnych interfejsów. Wspiera jednak przypisywanie dowolnych nazw interfejsom (nazywa się je etykietami). ifupdown używa tej funkcji do obsługi aliasowanych interfejsów podczas korzystania z ip .
  456.  
  457. Metoda iproute2
  458.  
  459. Ponadto ifupdown obsługuje określanie wielu interfejsów przez powtarzanie sekcji iface z tą samą nazwą interfejsu. Podstawową różnicą w stosunku do opisanej powyżej metody jest to, że wszystkie takie sekcje są traktowane przez ifupdown jako tylko jeden interfejs, więc użytkownik nie może ich dodawać ani usuwać pojedynczo. Jednak polecenia w górę / w dół , a także skrypty, są wywoływane dla każdej sekcji tak jak poprzednio.
  460.  
  461. Pamiętaj jednak, że ta metoda jest niebezpieczna ! Niektóre kombinacje sterowników / sprzętu mogą czasami nie doprowadzić do połączenia, jeśli do interfejsów aliasu nie zostaną przypisane żadne etykiety. (Widać to na Debian Wheezy i Jessie z RTL8111 / 8168/8411 PCI Express Gigabit Ethernet Controller (rev 01) auto-negocjowanie do 10 / full. Podobne ostrzeżenie od innej osoby istnieje w historii tej strony.)
  462.  
  463. Ten tekst / etc / network / interfaces przypisuje do eth0 trzy adresy IP.
  464.  
  465. auto eth0
  466. allow-hotplug eth0
  467. iface eth0 inet static
  468. adres 192.168.1.42
  469. maska ​​sieci 255.255.255.0
  470. bramka 192.168.1.1
  471.  
  472. iface eth0 inet static
  473. adres 192.168.1.43
  474. maska ​​sieci 255.255.255.0
  475.  
  476. iface eth0 inet static
  477. adres 192.168.1.44
  478. maska ​​sieci 255.255.255.0
  479.  
  480. # możliwe jest również dodawanie adresów IP z różnych podsieci
  481. iface eth0 inet static
  482. adres 10.10.10.14
  483. maska ​​sieci 255.255.255.0
  484.  
  485. Podejście ręczne:
  486.  
  487. auto eth0
  488. allow-hotplug eth0
  489. iface eth0 inet static
  490. adres 192.168.1.42
  491. maska ​​sieci 255.255.255.0
  492. bramka 192.168.1.1
  493. do ip addr dodaj 192.168.1.43/24 dev $ etykieta IFACE $ IFACE: 0
  494. down ip addr del 192.168.1.43/24 dev $ IFACE label $ IFACE: 0
  495. up ip addr add 192.168.1.44/24 dev $ etykieta IFACE $ IFACE: 1
  496. down ip addr del 192.168.1.44/24 dev $ IFACE label $ IFACE: 1
  497. up ip addr dodaj 10.10.10.14/24 dev $ IFACE label $ IFACE: 2
  498. down ip addr del 10.10.10.14/24 dev $ IFACE label $ IFACE: 2
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510. ####################################################################################################
  511. ####################################################################################################
  512. ####################################################################################################
  513.  
  514.  
  515.  
  516.  
  517. Setting up an Ethernet Interface
  518. Predictable Network Interface Names
  519. Using DHCP to automatically configure the interface
  520. Configuring the interface manually
  521. Setting the speed and duplex
  522. Bringing up an interface without an IP address
  523. Defining the (DNS) Nameservers
  524. The resolv.conf configuration file
  525. The resolvconf program
  526. DNS configuration for NetworkManager
  527. DHCP Client Configuration
  528. Bridging
  529. Bridging without Switching
  530. Howto use vlan (dot1q, 802.1q, trunk) (Etch, Lenny)
  531. Manual config
  532. Network init script config
  533. Bridges and VLANs
  534. Caveats when using bridging and vlan
  535. Howto create fault tolerant bonding with vlan (Etch)
  536. Network config
  537. bonding with active backup
  538. /etc/network/interfaces
  539. How to set the MTU (Max transfer unit / packet size) with VLANS over a bonded interface
  540. Multiple IP addresses on one Interface
  541. Legacy method
  542. iproute2 method
  543.  
  544. Setting up an Ethernet Interface
  545.  
  546. The majority of network setup can be done via the interfaces configuration file at /etc/network/interfaces. Here, you can give your network card an IP address (or use dhcp), set up routing information, configure IP masquerading, set default routes and much more.
  547.  
  548. Remember to add interfaces that you want brought up at boot time to the 'auto' line.
  549.  
  550. See man interfaces for more options.
  551.  
  552. Predictable Network Interface Names
  553.  
  554. As of Stretch, the old network names like eth0, eth1 have gone away as the device name can change. The new names are similar to these: enp6s0, enp8s0, enp0s31f6, enp5s0. Sadly, the system used is still somewhat arbitrary in that it relies on the BIOS enumeration which changes in with buggy BIOSs and under some situations. (That it wasn't based on a reduced sumcheck of the MAC address (2c:56:ac:39:ec:0d becomes 98) or some similar method is puzzling (udev can do such things) and the names we are left with are rather user unfriendly).
  555.  
  556. For people using more than one Network Interface - we will just have to deal with the new system.
  557.  
  558. To find the names of your interfaces you will want to look here: $ ls /sys/class/net/
  559.  
  560. Upgrading and Predictable Network Interface Names
  561.  
  562. Upgrades to Stretch will retain the old device names - despite what you will read on the web - removing /etc/udev/rules.d/70-local-persistent-net.rules will not give you the new names even if followed with a update-initramfs -u and update-grub. ( have not yet found the correct Debian incantations for this yet?? )
  563.  
  564. Using DHCP to automatically configure the interface
  565.  
  566. If you're just using DHCP then all you need is something like:
  567.  
  568. auto eth0
  569. allow-hotplug eth0
  570. iface eth0 inet dhcp
  571.  
  572. For DHCPv6 (used for IPv6), append also the following iface stanza
  573.  
  574. iface eth0 inet6 dhcp
  575.  
  576. Alternatively, IPv6 can be autoconfigured using stateless address autoconfiguration, or SLAAC, which is specified using auto instead of dhcp in the inet6 stanza:
  577.  
  578. iface eth0 inet6 auto
  579.  
  580. Configuring the interface manually
  581.  
  582. If you're configuring it manually then something like this will set the default gateway (network, broadcast and gateway are optional):
  583.  
  584. auto eth0
  585. iface eth0 inet static
  586. address 192.0.2.7
  587. netmask 255.255.255.0
  588. gateway 192.0.2.254
  589.  
  590. If you want to add an IPv6 address, too, append something like:
  591.  
  592. iface eth0 inet6 static
  593. address 2001:db8::c0ca:1eaf
  594. netmask 64
  595. gateway 2001:db8::1ead:ed:beef
  596.  
  597. See man interfaces for more options.
  598.  
  599. Make sure to disable all DHCP services, e.g. dhcpcd.
  600.  
  601. Setting the speed and duplex
  602.  
  603. Autonegotiation repeatedly failing is often a symptom of faulty cabling, so investigate physical matters before assuming that the interfaces' autonegotiation algorithms are incompatible. If you turn off autonegotiation and set speed and duplex manually then the partner interface at the other end of the cable will assume that the absence of autonegotiation indicates a speed of 10Mbps and a duplex of half. For error-free operation if you set speed and duplex manually you must ensure that exactly the same speed and duplex are configured on the partner interface.
  604.  
  605. If you set your interface's speed and duplex by hand, then some trial and error may be required. Here are the basic steps:
  606.  
  607. Install the ethtool and net-tools packages, so that you have the ethtool and mii-tool programs. One or both of these might work for your interface.
  608.  
  609. Make sure you have a way to login to the system in case the network interface becomes nonfunctional. An SSH connection could be disrupted, so you should have a fallback strategy.
  610. Identify the interface in question (it will often be eth0). Adjust the remainder of these instructions accordingly.
  611. Try to determine what its current speed and duplex settings are. This is where it gets fun:
  612.  
  613. As root, try ethtool eth0 first, and see whether the "Speed:" and "Duplex:" lines look valid. If not, the ethtool may not be supported by your device.
  614.  
  615. As root, try mii-tool -v eth0 and see whether its output looks correct. If not, them mii-tool may not be supported by your device.
  616.  
  617. If neither one is supported, you may have to set parameters directly on the kernel driver module. Identify which driver module you're using by reading the output of dmesg and lsmod. You can then try modinfo MODULENAME to see what parameters it accepts, if any. (You can use modinfo even on modules that are not loaded, for comparison.) ToDo: where does one set kernel module parameters?
  618. Next, try to change the settings of the interface while it's operating. You'll need to be root, of course. Either:
  619.  
  620. ethtool -s eth0 speed 100 duplex full autoneg off (assuming 100 Mbps and full duplex)
  621.  
  622. mii-tool -F 100baseTx-FD eth0 (same assumption)
  623. In each case, re-check to see whether the interface settings actually changed, and then try sending some data in and out of the system to see whether the NIC is operating correctly.
  624.  
  625. If one of these commands successfully set your NIC, then you can put it into /etc/network/interfaces so it runs when you bring the interface up (e.g. at boot time). However, before you do that, you should understand that some drivers and devices behave differently than others. When the driver module is loaded, the NIC may begin autonegotiation without any way to stop it (particularly with drivers that do not accept parameters). The settings from interfaces are applied at some point after that, which may be right in the middle of the negotiation. So, some people find it necessary to delay the ethtool or mii-tool command by a few seconds. Thus:
  626.  
  627. iface eth0 inet static
  628. address ...
  629. netmask ...
  630. gateway ...
  631. up sleep 5; ethtool -s eth0 ...
  632.  
  633. Or the analogous mii-tool command.
  634. Reboot the machine to make sure it comes up correctly, and be prepared to intervene manually (e.g. Ctrl-Alt-Del and then boot into single-user mode from GRUB or LILO) if things don't work.
  635.  
  636. Bringing up an interface without an IP address
  637.  
  638. To create a network interface without an IP address at all use the manual method and use pre-up and post-down commands to bring the interface up and down.
  639.  
  640. iface eth0 inet manual
  641. pre-up ifconfig $IFACE up
  642. post-down ifconfig $IFACE down
  643.  
  644. If the interface is a VLAN interface, the up/down commands must be executed after/before the vlan hooks. (You also have to install the vlan package.)
  645.  
  646. iface eth0.99 inet manual
  647. post-up ifconfig $IFACE up
  648. pre-down ifconfig $IFACE down
  649.  
  650. Note: If you create the VLAN interface only to put it into a bridge, there is no need to define the VLAN interface manually. Just configure the bridge, and the VLAN interface will be created automatically when creating the bridge (see below).
  651.  
  652. Defining the (DNS) Nameservers
  653.  
  654. Before a computer can connect to an external network resource (say, for example, a web server), it must have a means of converting any alpha-numeric names (e.g. wiki.debian.org) into numeric network addresses (e.g. 140.211.166.4). (The Internet uses these structured numeric IP addresses as network addresses.)
  655.  
  656. The C library and other resolver libraries look to /etc/resolv.conf for a list of nameservers. In the simplest case, that is the file to edit to set the list of name servers. But note that various other programs for dynamic configuration will be happy to overwrite your settings:
  657.  
  658. The resolvconf program
  659.  
  660. The network-manager daemon
  661. DHCP clients
  662.  
  663. In most situations, the file to edit is the configuration file for such a program.
  664.  
  665. In the most complex situations, using resolvconf really is the way to go, though in more simple configurations it is probably overkill.
  666.  
  667. The resolv.conf configuration file
  668.  
  669. The configuration file resolv.conf at /etc/resolv.conf contains information that allows a computer connected to a network to resolve names into addresses. (Note: Do not confuse this configuration file with the program resolvconf, which unfortunately has a nearly identical name.)
  670.  
  671. The resolv.conf file typically contains the IP addresses of nameservers (DNS name resolvers) that will attempt to translate names into addresses for any node available on the network. There will be a line or lines that look like this:
  672.  
  673. nameserver 12.34.56.78
  674. nameserver 12.34.56.79
  675.  
  676. In this example, the system is using nameservers at the IP addresses 12.34.56.78 and 12.34.56.79. Simply edit the file and enter the IP addresses of the nameservers you need to use after each nameserver. Add more nameserver lines if you have more nameservers. Don't use this method if you have the resolvconf program installed.
  677.  
  678. The resolv.conf configuration file has many other options for defining how resolver looks up names. See man resolv.conf for details.
  679.  
  680. The resolvconf program
  681.  
  682. The resolvconf program keeps track of system information about the currently available nameservers. It should not be confused with the configuration file resolv.conf, which unfortunately has a nearly identical name. The resolvconf program is optional on a Debian system.
  683.  
  684. The configuration file resolv.conf contains information about the nameservers to be used by the system. However, when multiple programs need to dynamically modify the resolv.conf configuration file they can step on each other and the file can become out-of-sync. The resolvconf program addresses this problem. It acts as an intermediary between programs that supply nameserver information (e.g. dhcp clients) and programs that use nameserver information (e.g. resolver).
  685.  
  686. When resolvconf is properly installed, the resolv.conf configuration file at /etc/resolv.conf is replaced by a symbolic link to /etc/resolvconf/run/resolv.conf and the resolver instead uses the configuration file that is dynamically generated by resolvconf at /etc/resolvconf/run/resolv.conf.
  687.  
  688. The resolvconf program is generally only necessary when a system has multiple programs that need to dynamically modify the nameserver information. In a simple system where the nameservers do not change often or are only changed by one program, the resolv.conf configuration file is adequate.
  689.  
  690. If the resolvconf program is installed, you should not edit the resolv.conf configuration file manually as it will be dynamically changed by programs in the system. If you need to manually define the nameservers (as with a static interface), add a line something like the following to the interfaces configuration file at /etc/network/interfaces:
  691.  
  692. dns-nameservers 12.34.56.78 12.34.56.79
  693.  
  694. Place the line indented within an iface stanza, e.g., right after the gateway line. Enter the IP addresses of the nameservers you need to use after dns-nameservers. Put all of them on one line separated by spaces. Don't forget the "s" on the end of dns-nameservers.
  695.  
  696. The resolvconf program is a fairly new addition to Debian and many older programs need to be updated or reconfigured to work properly with it. If you have problems, see /usr/share/doc/resolvconf/README. It has lots of information on making other programs get along with resolvconf.
  697.  
  698. DNS configuration for NetworkManager
  699.  
  700. NetworkManager will override dhcp settings, overwriting resolv.conf even if you've configured DNS in /etc/dhcp/dhclient.conf, e.g. causing DNS to first search the local domain, which may have to time out before DNS resolution continues causing lengthy DNS resolution times. You can get an idea of what NetworkManager thinks the settings should be by executing nm-tool at the command line.
  701.  
  702. You may configure these settings using a GUI by launching nm-connection-editor which currently (13.11.23) isn't to be found in System Tools → Administration menu, rather it must be launched by hand from the command line. After launching:
  703.  
  704. Choose a connection (from the Wired or Wireless tab) and click Edit.
  705. Click on the IPv4 Settings tab
  706. Choose 'Automatic (DHCP) addresses only' instead of just 'Automatic (DHCP)'.
  707. Enter the DNS servers in the “DNS servers” field, separated by spaces (e.g. 208.67.222.222 for OpenDNS).
  708. Click “Apply.”
  709.  
  710. NetworkManager saves these settings in /etc/NetworkManager/system-connections/name-of-connection. Example /etc/NetworkManager/system-connections/Wired connection 1 :
  711.  
  712. [802-3-ethernet]
  713. duplex=full
  714. mac-address=XX:XX:XX:XX:XX:XX
  715.  
  716. [connection]
  717. id=Wired connection 1
  718. uuid=xxx-xxxxxx-xxxxxx-xxxxxx-xxx
  719. type=802-3-ethernet
  720. timestamp=1385213042
  721.  
  722. [ipv6]
  723. method=auto
  724.  
  725. [ipv4]
  726. method=auto
  727. dns=208.67.222.222;
  728. ignore-auto-dns=true
  729.  
  730. Running nm-tool again should show that NetworkManager now has the right idea of how your DNS should be resolved.
  731.  
  732. DHCP Client Configuration
  733.  
  734. Example: dhclient3 uses /etc/dhcp/dhclient.conf. The setting you want is
  735.  
  736. supersede domain-name-servers 12.34.56.78, 12.34.56.79;
  737.  
  738. or perhaps
  739.  
  740. prepend domain-name-servers 12.34.56.78, 12.34.56.79;
  741.  
  742. See the dhclient.conf(5) manual page for details.
  743.  
  744. Bridging
  745.  
  746. Bridging puts multiple interfaces into the same network segment. This is very popular when connecting a server to multiple switches for high availability or with virtualization. In the latter case it is usually used to create a bridge in the host (eg. dom0) and put the virtual interfaces of the guests (domU) into the bridge.
  747.  
  748. Example: Connect a server to 2 switches (via eth0 and eth1) by defining bridge 0 and give the server an IP address in this subnet:
  749.  
  750. auto br0
  751. iface br0 inet static
  752. address 10.10.0.15
  753. netmask 255.255.255.0
  754. gateway 10.10.0.1
  755. bridge_ports eth0 eth1
  756. up /usr/sbin/brctl stp br0 on
  757.  
  758. If a server is connected to multiple switches then you usually need to run the spanning tree protocol to avoid loops. Therefore STP must be turned on via an "up" command as shown above.
  759.  
  760. Example: Bridge setup without IP address configuration (use "manual" instead of "static") to "forward" an interface to a guest VM. (The static bridge config contains only 1 physical interface. The virtual interface will be added to the bridge when the VM is started.)
  761.  
  762. auto br1
  763. iface br1 inet manual
  764. bridge_ports eth4
  765. up /usr/sbin/brctl setageing br1 0
  766. up /usr/sbin/brctl stp br0 off
  767.  
  768. Note: The Linux bridge supports only STP, no RSTP (Rapid Spanning Tree). Therefore it supports only the old STP Costs, not the new RSTP Costs (see Spanning_Tree_Protocol). This is usually fine with Cisco Switches, but eg. Juniper switches use the RSTP costs and therefore this may lead to different spanning tree calculations and loop problems. This can be fixed by settings the costs manually, either on the switch or on the server. Setting the cost on the switch is preferred as Linux switches back to the default costs whenever an interface does down/up.
  769.  
  770. Bridging without Switching
  771.  
  772. By default the Linux bridge acts like a switch. This means, it remembers the MAC addresses behind a switch port and if the destination MAC address is known, data packets or only forward to the respective port - otherwise packets will be broadcasted.
  773.  
  774. In some setups this is bad. For example if the bridge connects 2 trunk interfaces and the same MAC addresses may be seen from both interfaces, depending on the VLAN. As the Linux bridge does not support VLANs (dedicated MAC address tables per each VLAN), in such setups you have to disable the MAC address learning and put the bridge into a real "bridge" mode with:
  775.  
  776. up /sbin/brctl setageing br0 0
  777. up /sbin/brctl stp br0 off
  778.  
  779. Howto use vlan (dot1q, 802.1q, trunk) (Etch, Lenny)
  780.  
  781. Manual config
  782.  
  783. modprobe 8021q
  784.  
  785. apt-get install vlan
  786.  
  787. vconfig add eth0 222 # 222 is vlan number
  788. ifconfig eth0.222 up
  789. ifconfig eth0.222 mtu 1496 #optional if your network card doesn't support MTU 1504B
  790. ifconfig eth0.222 10.10.10.1 netmask 255.255.255.0
  791.  
  792. Network init script config
  793.  
  794. Into /etc/modules add line:
  795.  
  796. 8021q
  797.  
  798. In /etc/network/interfaces to section iface add parameter:
  799.  
  800. vlan-raw-device eth0
  801.  
  802. The interface name should be the raw interface name (the same as specified by vlan-raw-device), then a dot, then the VLAN ID, for example eth0.100. It can instead be "vlan" then the VLAN ID, for example vlan100. In either case, the VLAN ID is on the end, and this is the only place that it is configured.
  803.  
  804. Note: If you name your VLAN interfaces ethX.YYY, then there is no need to specify the vlan-raw-device, as the raw device can be retrieved from the interface name.
  805.  
  806. Eg:
  807.  
  808. auto eth0.222
  809. iface eth0.222 inet static
  810. address 10.10.10.1
  811. netmask 255.255.255.0
  812. vlan-raw-device eth0
  813.  
  814. Bridges and VLANs
  815.  
  816. If you create VLAN interfaces only to put them into a bridge, there is no need to define the VLAN interfaces manually. Just config the bridge, and the VLAN interface will be created automatically when creating the bridge, e.g:
  817.  
  818. auto br1
  819. iface br1 inet manual
  820. bridge_ports eth0.99 eth1.99
  821. up /usr/sbin/brctl stp br0 on
  822.  
  823. Caveats when using bridging and vlan
  824.  
  825. #/etc/network/interfaces
  826. auto eth0 bri0
  827. iface eth0 inet static
  828. address 192.168.1.1
  829. netmask 255.255.255.0
  830. iface eth0.110 inet manual
  831. vlan-raw-device eth0
  832. iface bri0 inet static
  833. address 192.168.110.1
  834. netmask 255.255.255.0
  835. bridge_ports eth0.110
  836. bridge_stp on
  837. bridge_maxwait 10
  838.  
  839. If you are using a brigded VLAN setup, which is probably useful for networking in virtualization environments, take care to only attach either a bridge device or VLAN devices to an underlying physical device - like shown above. Attaching the physical interface (eth0) to a bridge (eg. bri1) while using the same physical interface on apparently different VLANs will result in all packets to remain tagged. (Kernel newer than 2.6.37 and older than 3.2).
  840.  
  841. Howto create fault tolerant bonding with vlan (Etch)
  842.  
  843. debian_bonding.png
  844.  
  845. debian_bonding.dia
  846.  
  847. How to configure one of the above server active backup bonding 3 vlan {vlan10,vlan20,vlan30} Debian networking without SPOF without native vlan.
  848.  
  849. aptitude install vlan ifenslave-2.6
  850.  
  851. Network config
  852.  
  853. Cisco switch interface example config
  854.  
  855. interface GigabitEthernet1/2
  856. description eth1
  857. switchport
  858. switchport trunk encapsulation dot1q
  859. switchport trunk allowed vlan 10,20,30
  860. switchport mode trunk
  861. no ip address
  862. no cdp enable
  863. spanning-tree portfast trunk
  864.  
  865. bonding with active backup
  866.  
  867. Create a file /etc/modprobe.d/bonding.conf containing:
  868.  
  869. alias bond0 bonding
  870. options bonding mode=active-backup miimon=100 downdelay=200 updelay=200 primary=eth1
  871.  
  872. /etc/network/interfaces
  873.  
  874. # The loopback network interface
  875. auto lo
  876. iface lo inet loopback
  877. # The primary network interface
  878. auto bond0
  879. iface bond0 inet manual
  880. up ifconfig bond0 0.0.0.0 up
  881. slaves eth1 eth0
  882. auto vlan10
  883. iface vlan10 inet static
  884. address 10.10.10.12
  885. netmask 255.255.0.0
  886. vlan-raw-device bond0
  887. gateway 10.10.0.1
  888. dns-search hup.hu
  889. dns-nameservers 10.10.0.2
  890. auto vlan20
  891. iface vlan20 inet static
  892. address 10.20.10.12
  893. netmask 255.255.0.0
  894. vlan-raw-device bond0
  895. auto vlan30
  896. iface vlan30 inet static
  897. address 10.30.10.12
  898. netmask 255.255.0.0
  899. vlan-raw-device bond0
  900.  
  901. How to set the MTU (Max transfer unit / packet size) with VLANS over a bonded interface
  902.  
  903. MTU needs to be configured on the bonding interface and slave interfaces after the reset of the configuration has been applied to the bonding interfaces. This is done using a post-up line in the bonding interface configuration.
  904.  
  905. auto bond0
  906. iface bond0 inet manual
  907. up ifconfig lacptrunk0 0.0.0.0 up
  908. slaves eth0 eth1
  909. # bond-mode 4 = 802.3ad
  910. bond-mode 4
  911. bond-miimon 100
  912. bond-downdelay 200
  913. bond-updelay 200
  914. bond-lacp-rate 1
  915. bond-xmit-hash-policy layer2+3
  916. post-up ifconfig eth0 mtu 9000 && ifconfig eth1 mtu 9000 && ifconfig bond0 mtu 9000
  917.  
  918. #vlan devices will use the MTU set on bond0 device
  919. auto vlan101
  920. iface vlan101 inet static
  921.  
  922. address 10.101.60.123
  923. netmask 255.255.255.0
  924. gateway 10.155.60.1
  925. vlan-raw-device bond0
  926.  
  927. auto vlan151
  928. iface vlan151 inet static
  929.  
  930. address 192.168.1.1
  931. netmask 255.255.255.0
  932. vlan-raw-device bond0
  933.  
  934. Multiple IP addresses on one Interface
  935.  
  936. Interface aliasing allows one interface to have multiple IP addresses. This is useful when more than one server is to be visible via the Internet. Note that virtual hosts can support multiple Apache servers with a single IP address. Apache responds to the domain name supplied by the client in the HTTP header. In many other situations, one external IP is needed for each server using a port.
  937.  
  938. Legacy method
  939.  
  940. This /etc/network/interfaces text assigns three IP addresses to eth0.
  941.  
  942. auto eth0
  943. allow-hotplug eth0
  944. iface eth0 inet static
  945. address 192.168.1.42
  946. netmask 255.255.255.0
  947. gateway 192.168.1.1
  948.  
  949. auto eth0:0
  950. allow-hotplug eth0:0
  951. iface eth0:0 inet static
  952. address 192.168.1.43
  953. netmask 255.255.255.0
  954.  
  955. auto eth0:1
  956. allow-hotplug eth0:1
  957. iface eth0:1 inet static
  958. address 192.168.1.44
  959. netmask 255.255.255.0
  960.  
  961. An alias interface should not have "gateway" or "dns-nameservers"; dynamic IP assignment is permissible.
  962.  
  963. The above configuration is the previous traditional method that reflects the traditional use of ifconfig to configure network devices. ifconfig has introduced the concept of aliased or virtual interfaces. Those types of virtual interfaces have names of the form interface:integer and ifconfig treats them very similarly to real interfaces.
  964.  
  965. Nowadays ifupdown uses the ip utility from the iproute2 package instead of ifconfig. The newer ip utility does not use the same concept of aliases or virtual interfaces. However, it supports assigning arbitrary names to the interfaces (they're called labels). ifupdown uses this feature to support aliased interfaces while using ip.
  966.  
  967. iproute2 method
  968.  
  969. Also, ifupdown supports specifying multiple interfaces by repeating iface sections with the same interface name. The key difference from the method described above is that all such sections are treated by ifupdown as just one interface, so user can't add or remove them individually. However, up/down commands, as well as scripts, are called for every section as it used to be.
  970.  
  971. Note however that this method is dangerous! Certain driver/hardware combinations may sometimes fail to bring the link up if no labels are assigned to the alias interfaces. (Seen this on Debian Wheezy and Jessie with RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 01) auto-negotiating to 10/full. A similar warning from another person exists in the history of this page.)
  972.  
  973. This /etc/network/interfaces text assigns three IP addresses to eth0.
  974.  
  975. auto eth0
  976. allow-hotplug eth0
  977. iface eth0 inet static
  978. address 192.168.1.42
  979. netmask 255.255.255.0
  980. gateway 192.168.1.1
  981.  
  982. iface eth0 inet static
  983. address 192.168.1.43
  984. netmask 255.255.255.0
  985.  
  986. iface eth0 inet static
  987. address 192.168.1.44
  988. netmask 255.255.255.0
  989.  
  990. # adding IP addresses from different subnets is also possible
  991. iface eth0 inet static
  992. address 10.10.10.14
  993. netmask 255.255.255.0
  994.  
  995. Manual approach:
  996.  
  997. auto eth0
  998. allow-hotplug eth0
  999. iface eth0 inet static
  1000. address 192.168.1.42
  1001. netmask 255.255.255.0
  1002. gateway 192.168.1.1
  1003. up ip addr add 192.168.1.43/24 dev $IFACE label $IFACE:0
  1004. down ip addr del 192.168.1.43/24 dev $IFACE label $IFACE:0
  1005. up ip addr add 192.168.1.44/24 dev $IFACE label $IFACE:1
  1006. down ip addr del 192.168.1.44/24 dev $IFACE label $IFACE:1
  1007. up ip addr add 10.10.10.14/24 dev $IFACE label $IFACE:2
  1008. down ip addr del 10.10.10.14/24 dev $IFACE label $IFACE:2
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017. ##########################################################
  1018. ##### NETWORK 3G ####
  1019. ##########################################################
  1020.  
  1021.  
  1022.  
  1023.  
  1024. Jak podłączyć laptopa do Internetu za pomocą telefonu komórkowego przez USB lub Bluetooth
  1025.  
  1026. W tym artykule opiszę, jak łatwo podłączyć laptopa do Internetu za pomocą telefonu komórkowego jako modemu 3G / GPRS przez Bluetooth lub USB.
  1027.  
  1028. Procedura została przetestowana na laptopie Toshiba Satellite z pakietem Debian SID (2.6.26-1-686) i telefonem Nokia N80 podłączonym do hiszpańskiej sieci mobilnej Movistar. Z pewnością należy nieznacznie zmienić parametry podane w tym dokumencie, aby inne połączenie działało ...
  1029.  
  1030. Bardzo ważne jest ścisłe przestrzeganie wszystkich kroków związanych z tym artykułem.
  1031.  
  1032. Uwaga: Aby uzyskać ogólne informacje na temat konfigurowania Bluetooth, zobacz także stronę BluetoothUser .
  1033.  
  1034. Parowanie laptopa z telefonem komórkowym
  1035.  
  1036. Przede wszystkim musisz sparować laptopa z telefonem komórkowym. Do pobrania niektórych pakietów potrzebne jest aktywne połączenie internetowe z laptopem. Będziemy używać pakietu kdebluetooth . Chociaż sam jestem użytkownikiem Gnome, znalazłem ten pakiet bardzo przydatny. Tak więc otwórzmy konsolę i wpiszmy jako root:
  1037.  
  1038. # apt-get install kdebluetooth
  1039.  
  1040. Spowoduje to zainstalowanie pakietu. Następnie wpiszmy jako zwykły użytkownik:
  1041.  
  1042. $ kbluetooth
  1043.  
  1044. Wtedy na pasku zadań pojawi się mała niebieska ikona ...
  1045.  
  1046. Jeśli klikniemy na niego prawym przyciskiem myszy i wybierz opcję KONFIGURACJA ... ADAPTERY ... wtedy będziemy mogli skonfigurować laptopa, aby ustawić go w trybie ODKRYWANIA ...
  1047.  
  1048. Po tym aktywujemy Bluetooth w telefonie komórkowym i próbujemy wykryć laptopa ... Po odkryciu laptopa przez telefon, poprosimy nas o wprowadzenie hasła numerycznego: po prostu wpisz coś łatwego jak "123", jeśli myślisz nie ma zagrożenia bezpieczeństwa ... (To tylko jednorazowe hasło). Zostaniesz poproszony o powtórzenie tego samego hasła na swoim laptopie . Aby uniknąć powtarzania tego procesu za każdym razem, gdy parujesz laptopa z telefonem komórkowym, zdecydowanie zalecamy dodanie laptopa jako zaufanego urządzenia (jest to opcja łatwo dostępna w menu bluetooth na telefonie komórkowym ) ... Et voi-là ... nasze urządzenia są po prostu sparowane!
  1049.  
  1050. Konfigurowanie parametrów MODEM
  1051.  
  1052. Teraz musimy skonfigurować parametry modemu twojego telefonu komórkowego.
  1053.  
  1054. Najpierw podłącz telefon komórkowy do laptopa za pomocą kabla USB ... Ważne jest, aby telefon komórkowy nie utracił łączności w tym momencie, tak aby był bezużyteczny, gdyby podłączyłeś telefon komórkowy przez USB w "Transfer plików "Tryb ... Musisz podłączyć go w taki sposób, aby telefon nadal działał. W przypadku Nokia N80 wybierz opcję "PC-Suite" ...
  1055.  
  1056. A następnie wpisz jako root:
  1057.  
  1058. # apt-get install wvdial
  1059. # wvdialconf
  1060.  
  1061. Po wykonaniu tej czynności wvdialconf sprawdził twój telefon komórkowy i po udanym połączeniu z nim ustalił poprawne parametry modemu i zapisał go do pliku. Ale teraz musimy ulepszyć ten plik konfiguracyjny, abyśmy mogli wpisać jako root:
  1062.  
  1063. # apt-get install gedit
  1064. # gedit /etc/wvdial.conf
  1065.  
  1066. Musisz usunąć następujące wiersze kodu:
  1067.  
  1068. Modem Type = USB Modem
  1069. Modem = / dev / ttyACM0
  1070.  
  1071. Musisz dodać następujące wiersze na końcu edytowanego pliku w tej samej kolejności, w jakiej występuje tutaj:
  1072.  
  1073. Nowe PPPD = tak
  1074. Telefon = * 99 *** 1 #
  1075. Nazwa użytkownika = MOVISTAR
  1076. Hasło = MOVISTAR
  1077. Init6 = AT + CGDCONT = 1, "IP", "movistar.es"
  1078.  
  1079. [Dialer usb-scb]
  1080. Modem Type = USB Modem
  1081. Modem = / dev / ttyACM0
  1082.  
  1083. [Dialer blz-scb]
  1084. Modem = / dev / rfcomm0
  1085.  
  1086. Teraz zapisujemy plik bez zmiany nazwy ani lokalizacji i jesteśmy gotowi. Modem telefonu komórkowego jest w pełni skonfigurowany i możemy go używać niewyraźnie przez USB lub Bluetooth (jak wolisz) bez zmiany jakiegokolwiek parametru ...
  1087.  
  1088. Przywracanie sieci
  1089.  
  1090. Przed podłączeniem laptopa do telefonu komórkowego musimy najpierw usunąć istniejące połączenie sieciowe. Aby to zrobić, wpisujemy jako root:
  1091.  
  1092. # ifconfig eth0 down
  1093. # mv /etc/resolv.conf /etc/resolv.conf.eth0
  1094.  
  1095. A eth0 to nazwa aktywnego interfejsu sieciowego. Jeśli nie masz pewności co do nazwy interfejsu, po prostu wpisz jako root:
  1096.  
  1097. # ifconfig
  1098.  
  1099. Aby pojawiły się wszystkie aktywne interfejsy ...
  1100.  
  1101. Ustawienia DNS
  1102.  
  1103. Aby korzystać z Internetu, będziesz potrzebować poprawnych ustawień DNS. Zwykle po podłączeniu będziesz automatycznie otrzymywać ustawienia DNS, więc nie musisz nic robić.
  1104.  
  1105. Jeśli jednak sieć komórkowa tego wymaga, konieczne może być ręczne ustawienie serwerów DNS. Aby to zrobić:
  1106.  
  1107. # echo "nameserver 194.179.1.100"> /etc/resolv.conf
  1108. # echo "nameserver 194.179.1.101" >> /etc/resolv.conf
  1109.  
  1110. Przykładowe serwery nazw są ważne tylko wtedy, gdy łączysz się z hiszpańską siecią mobilną Movistar ... sprawdź odpowiednie ustawienia swojej sieci komórkowej.
  1111.  
  1112. Łączenie przez USB
  1113.  
  1114. Jeśli chcesz podłączyć laptopa do Internetu przez USB do telefonu komórkowego. Wystarczy podłączyć kable i wpisać jako root:
  1115.  
  1116. # wvdial usb-scb &
  1117.  
  1118. Jesteś skończony. Możesz surfować po Internecie lub sprawdzać pocztę e-mail ... ;-)
  1119.  
  1120. Łączenie przez Bluetooth
  1121.  
  1122. Jeśli chcesz połączyć swój laptop z Internetem przez Bluetooth z telefonem komórkowym. Wystarczy włączyć Bluetooth w laptopie i telefonie komórkowym, a następnie wpisać jako root:
  1123.  
  1124. # Skanowanie hcitool
  1125.  
  1126. Pojawią się następujące informacje:
  1127.  
  1128. Łów...
  1129. 00: 11: 22: 33: 44: 55 NameDevice
  1130.  
  1131. Jest to adres MAC i nazwa przypisana urządzeniu Bluetooth telefonu komórkowego. Teraz wpisujesz jako root (używając tego samego adresu MAC co powyżej):
  1132.  
  1133. # rfcomm connect 0 00: 11: 22: 33: 44: 55 2 i
  1134.  
  1135. Po nawiązaniu połączenia wpisujesz jako root:
  1136.  
  1137. # wvdial blz-scb &
  1138.  
  1139. Jesteś skończony. Możesz surfować po Internecie lub sprawdzać pocztę e-mail ... ;-)
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149. -------------------------------------------------------------------------------------------------------------------------
  1150.  
  1151. Wsparcie sprzętowe
  1152. Instalacja z PPP i / etc / network / interfaces
  1153. Zaawansowana instalacja z WVDial
  1154. Dla Novatel
  1155. Dla opcji
  1156. Dodatkowe kroki dla karty HSDPA
  1157. Dodatkowe kroki dla karty Novatel U740
  1158. Dodatkowe kroki dla kart Huawei
  1159. Huawei E169
  1160. Huawei E220
  1161. Uwagi
  1162. Jak połączyć za pomocą modemu bezprzewodowego Wi-Fi / WAN / mobilnego modemu Franklin U210
  1163. FAQ
  1164. DO ZROBIENIA
  1165. Zasoby
  1166. Linki zewnętrzne
  1167.  
  1168. Wsparcie sprzętowe
  1169.  
  1170. Następujące karty / telefony działają w 100% z następnymi skryptami / konfiguracjami:
  1171.  
  1172. BandLuxe C100
  1173. Huawei / E176 (działa po wyjęciu z pudełka)
  1174.  
  1175. Huawei / E169 działa bez żadnych problemów
  1176.  
  1177. Huawei / E220
  1178. Huawei / E620
  1179.  
  1180. Huawei / K3565-Z
  1181. Motorola E1000
  1182. Nokia 6680 (po prostu nie ustawiaj prędkości / usługi - bez konfiguracji 3gonly i 384k)
  1183.  
  1184. Nokia N80 (z ładnym How-To UseYourCellPhoneAsModem )
  1185. Karta Novatel HSDPA
  1186. Novatel Merlin U630
  1187. Opcja Fusion
  1188. Opcja Karta HSDPA
  1189. Opcja Quad
  1190.  
  1191. Instalacja z PPP i / etc / network / interfaces
  1192.  
  1193. Działa to z Debian Wheezy 7.
  1194.  
  1195. Zainstaluj pakiety netbase , ifupdown i ppp, jeśli jeszcze ich nie masz:
  1196.  
  1197. apt-get install netbase ifupdown ppp
  1198.  
  1199. Utwórz plik / etc / ppp / peers / gprs z tą zawartością:
  1200.  
  1201. użytkownik "YOUR_USERNAME"
  1202. połącz "/ usr / sbin / chat -v -f / etc / chatscripts / gprs -T YOUR_APN"
  1203. / dev / ttyUSB0
  1204. noipdefault
  1205. Trasa domyślna
  1206. replaceefaultroute
  1207. Ukryj hasło
  1208. # lcp-echo-interval 30
  1209. # lcp-echo-failure 4
  1210. noauth
  1211. trwać
  1212. #mtu 1492
  1213. #maxfail 0
  1214. #holdoff 20
  1215. usepeerdns
  1216. #Opcjonalnie, spraw, aby zawsze wyglądało jak ppp2:
  1217. #rozdział 2
  1218.  
  1219. Następnie edytuj / etc / ppp / chap-secrets i dodaj na końcu:
  1220.  
  1221. "YOUR_USERNAME" * "YOUR_PASSWORD"
  1222.  
  1223. Podobnie, edytuj / etc / ppp / pap-secrets i dodaj na końcu:
  1224.  
  1225. "YOUR_USERNAME" * "YOUR_PASSWORD"
  1226.  
  1227. Następnie edytuj plik / etc / network / interfaces i dodaj:
  1228.  
  1229. auto GPRS
  1230. iface gprs inet ppp
  1231. dostawca gprs
  1232.  
  1233. To wszystko, czego potrzebujesz przez większość czasu. Połączenie zostanie uruchomione podczas startu, możesz uruchomić go z pomocą gprs ifup lub zatrzymać go za pomocą ifdown gprs .
  1234.  
  1235. Zaawansowana instalacja z WVDial
  1236.  
  1237. Musisz pobrać nowy plik wvdial.conf dla rzeczy HSDPA do pracy !!!
  1238.  
  1239. Pierwotnie został napisany dla Gentoo Linux, który kompiluje wszystko od źródła. W rezultacie rzeczy mogą być nieco inne, ale możemy obejść to. Po pierwsze, musimy zmusić Linuksa do wykrycia karty, uruchomienia usług PCMCIA - zwykle można to zrobić za pomocą (większość dystrybucji robi to za Ciebie):
  1240.  
  1241. Zanim włożysz kartę, otwórz konsolę / przełącz się do otwartej konsoli i jako root uruchom następujące:
  1242.  
  1243. Rozpocznij invoke-rc.d pcmciautils
  1244.  
  1245. To pozwoli ci "zobaczyć", co robi Linux:
  1246.  
  1247. tail -f / var / log / messages
  1248.  
  1249. Właśnie teraz włóż kartę i powinieneś zobaczyć, co się dzieje. Dołączyłem ślady dzienników tego, co dwie karty "wyglądają" jak w / var / log / messages w sekcji załączników.
  1250.  
  1251. Jeśli widzisz tylko wiadomości option_insert_nousb.txt za pomocą karty opcji, uruchom następujące polecenie:
  1252.  
  1253. modprobe usbserial vendor = 0x0af0 product = 0x5000
  1254.  
  1255. Jeśli musisz uruchomić powyższe polecenie, musisz zapisać plik vmc_g dołączony do /etc/modules.d .
  1256.  
  1257. Teraz musimy dowiedzieć się, gdzie znajduje się twoja karta - zobaczysz w wiadomościach, gdzie znajduje się karta - / dev / ttyS * dla Novatel lub / dev / ttyUSB * dla opcji:
  1258.  
  1259. znajdź / dev / | grep ttyS
  1260.  
  1261. Powinien pokazać / dev / ttyS0 lub / dev / ttyS1 dla karty Novatel.
  1262.  
  1263. znajdź / dev / | grep ttyUSB
  1264.  
  1265. Powinien pokazać / dev / ttyUSB0 i USB1 i USB2 dla karty opcji. (lub / dev / tts / ttyUSB0-2 dla udev)
  1266.  
  1267. Kiedy to stwierdziliśmy, musimy zmienić plik /etc/wvdial.conf, aby pasował do twoich ustawień, załączony jest mój działający plik wvdial.conf (ten jest testowany w sieci GSM Play w Polsce, z modemem e169, ale nie używa żadnych konkretnych opcji, więc powinien być bardzo przenośnym). Plik to:
  1268.  
  1269. [Domyślne ustawienia dialera]
  1270. Modem = / dev / ttyUSB0
  1271. Baud = 3600000
  1272. Init1 = ATZ
  1273. Init2 = ATQ0 V1 E1 S0 = 0 i C1 & D2 + FCLASS = 0
  1274. Telefon = * 99 #
  1275. Nazwa użytkownika = ppp
  1276. Hasło = ppp
  1277. Zapytaj hasło = 0
  1278. Wybierz polecenie = ATDT
  1279. Tryb głupi = 1
  1280. Compuserve = 0
  1281. Idle Seconds = 0
  1282. ISDN = 0
  1283. Auto DNS = 1
  1284.  
  1285. Możliwe jest ustawienie kodu PIN wysyłanego do modemu w celu odblokowania karty SIM, jakkolwiek ten przykład nie korzysta z tej opcji (należy ją wyszukać). Niektóre karty SIM nie potrzebują kodu PIN do pracy jako modemy.
  1286.  
  1287. Teraz możemy zacząć dzwonić.
  1288.  
  1289. Dla Novatel
  1290.  
  1291. wvdial novatel internet 3gonly 384k
  1292.  
  1293. Dla opcji
  1294.  
  1295. opcja wvdial internet 3gonly 384k
  1296.  
  1297. Jeśli chcesz wysłać swój PIN, dodaj "pin" przed wszystkimi poleceniami, np
  1298.  
  1299. wvdial pin novatel internet 3gonly 384k
  1300.  
  1301. Po nawiązaniu połączenia - odpocznij Teraz możesz skonfigurować takie ustawienia, jak KPPP i Modem Lights Gnome, aby wykonać wybieranie.
  1302.  
  1303. Dodatkowe kroki dla karty HSDPA
  1304.  
  1305. Pobierz moduł jądra z linku poniżej. Wyodrębnij go do katalogu gdzieś bezpieczny.
  1306.  
  1307. Skompiluj sterownik za pomocą następujących poleceń:
  1308.  
  1309. czyść i czyń
  1310.  
  1311. Gdy to zrobisz, uruchom następujące polecenie, aby wstawić moduł do jądra
  1312.  
  1313. insmod nozomi.ko
  1314.  
  1315. Gdy to zrobisz, użyj następującego polecenia, aby skonfigurować połączenie:
  1316.  
  1317. wvdial hsdpa
  1318.  
  1319. Dodatkowe kroki dla karty Novatel U740
  1320.  
  1321. Dopóki nie dostanę czasu na aktualizację plików itp. Nasi użytkownicy Linuksa Novatel mogą po prostu wpisać to polecenie przed użyciem zwykłego polecenia wybierania:
  1322.  
  1323. modprobe usbserial vendor = 0x1410 product = 0x1400
  1324.  
  1325. LUB
  1326.  
  1327. modprobe usbserial vendor = 0x1410 product = 0x1410
  1328.  
  1329. Używanie lsusb pokazuje, że sprzedawca i identyfikator produktu lub cat / proc / bus / usb / devices zrobią to samo.I nadal będę dodawać je do FAQ, ale przynajmniej powinno to pomóc na teraz
  1330.  
  1331. To doda USB jak w opcji 3G - czy widzę tutaj swap? - po prostu wybierz / dev / ttyUSB0 lub tak - sprawdź logi
  1332.  
  1333. Dodatkowe kroki dla kart Huawei
  1334.  
  1335. Nic naprawdę - po prostu upewnij się, że usbserial jest załadowany, a karta pojawi się na / dev / ttyUSB0 - sprawdź logi ponownie, aby potwierdzić
  1336.  
  1337. Jeśli karta nie pojawi się, wyładuj usbserial i załaduj ponownie za pomocą następującego polecenia:
  1338.  
  1339. rmmod usbserial
  1340. modprobe usbserial vendor = 0x12d1 product = 0x1001
  1341.  
  1342. Nadal próbuję pracować na karcie tylko USB, więc w tej chwili nie wiem, czy będzie działać pod Linuksem.
  1343.  
  1344. Huawei E169
  1345.  
  1346. Testowane przez rfree na Debian Wheezy z polskim operatorem Play. Wszystko działa dobrze:
  1347.  
  1348. upewnij się z stat / dev / ttyUSB0 że taki plik urządzenia zostanie (ponownie) utworzony po podłączeniu modemu (i poczekaj 10 sekund), data pliku powinna się zmienić.
  1349. jeśli plik urządzenia nie został utworzony (lub jeśli coś nie działa), zmusić modem do pracy jako modem tylko zamiast czytnika kart / pamięci, używając:
  1350.  
  1351. rmmod usb_storage
  1352. modprobe usbserial vendor = 0x0af0 product = 0x5000 # (lub dostosuj dostawcę i produkt
  1353. numer do tych, które widzisz w dmesg lub lsusb, gdy szukasz swojego modemu)
  1354.  
  1355. skopiuj załączony przykładowy plik wvdial.conf-e169 do /etc/wvdial.conf
  1356.  
  1357. biegać wvdial (zainstaluj wvdial, jeśli go nie masz) - i powinno być zrobione
  1358.  
  1359. Huawei E220
  1360.  
  1361. Odkryłem, że modem działa tylko z dostarczonym krótkim kablem ... nie długim z dwoma wtyczkami ... * wzruszam ramionami *
  1362.  
  1363. Taki sam jak E620, z wyjątkiem użycia następującej komendy modprobe:
  1364.  
  1365. rmmod usb-storage
  1366. modprobe usbserial vendor = 0x12d1 product = 0x1003
  1367.  
  1368. (Niektórzy zgłaszają ID 0x1001 - użyj lsusb do potwierdzenia) Po tym zauważysz, że nadchodzi tylko jeden serial USB, następnie usuń urządzenie i ponownie je załącz, nie powinieneś ponownie wkładać usbserial.
  1369.  
  1370. Uwagi
  1371.  
  1372. Widziałem tylko prędkości 3G na tym urządzeniu, ale myślę, że to ze względu na moje warunki i lokalizację fal radiowych. Więcej na ten temat, aby śledzić ...
  1373.  
  1374. Jak połączyć za pomocą modemu bezprzewodowego Wi-Fi / WAN / mobilnego modemu Franklin U210
  1375.  
  1376. Chociaż ta sekcja wymaga pracy, dokumentuje, w jaki sposób jeden użytkownik Debiana łączy się z Internetem za pośrednictwem sieci komórkowej NTelos w Stanach Zjednoczonych za pomocą modemu USB Franklin CDMA EV-DO U210. NTelos używa sieci Sprint, a ponadto wydaje się, że U210 Franklina jest podstawowym modelem serii U Franklina (U210, U600, U601, U602, U770, U772), więc istnieje dość duża szansa, że ​​możesz użyć tych informacji nawet jeśli twoja sytuacja różni się trochę od sytuacji pisarza - ale, jak mówią, twój przebieg może się różnić.
  1377.  
  1378. Ta rada jest skierowana do początkujących i średnio zaawansowanych użytkowników. Zaawansowani użytkownicy są zachęcani do edycji wiki w celu ulepszenia porady.
  1379.  
  1380. Modem USB firmy Franklin prezentuje się w sieci bezprzewodowej tak, jakby był telefonem komórkowym. Ma numer telefonu. Aby się połączyć, dzwoni inny numer telefonu. W sieci NTelos (i prawdopodobnie także w sieci Sprint) w Stanach Zjednoczonych numer telefonu, który musi posiadać modem USB, to "# 777". Nie musisz, ale prawdopodobnie możesz odkryć swój numer telefonu modemu USB, logując się na swoje konto na stronie internetowej operatora komórkowego. Jedynym numerem, którego potrzebujesz dzisiaj, jest "# 777".
  1381.  
  1382. Jako root lub przez sudo (1) zainstaluj pakiet "wvdial" Debiana, na przykład przez
  1383.  
  1384. $ sudo apt-get install wvdial
  1385.  
  1386. Jeśli zachodzi taka potrzeba, zapisz oryginalny stan pliku /etc/wvdial.conf za pomocą RC (ci) (1) lub podobnego (możesz zignorować tę radę, jeśli nie znasz i nie dbasz o to, co to jest). Zmodyfikuj plik /etc/wvdial.conf, aby wyglądał mniej więcej tak:
  1387.  
  1388. [Domyślne ustawienia dialera]
  1389. Tryb głupi = prawda
  1390. Init1 = ATZ
  1391. Init2 = ATQ0 V1 E1 S0 = 0 i C1 & D2 + FCLASS = 0
  1392. Modem Type = USB Modem
  1393. Baud = 460800
  1394. Nowe PPPD = tak
  1395. Modem = / dev / ttyACM0
  1396. ISDN = 0
  1397. Telefon = # 777
  1398. Hasło = <Twoje hasło>
  1399. Nazwa użytkownika = <Twoja nazwa użytkownika>
  1400.  
  1401. Ważne linie to "Tryb głupi = prawda" i "Telefon = 777". Nie musisz podawać hasła ani nazwy użytkownika.
  1402.  
  1403. Edytuj "/ etc / group" [ponownie po użyciu ci (1) najpierw, jeśli chcesz] zmienić
  1404.  
  1405. dialout: x: 20:
  1406.  
  1407. do
  1408.  
  1409. dialout: x: 20: foo
  1410.  
  1411. wpisując swoją nazwę użytkownika zamiast "foo".
  1412.  
  1413. W tym momencie może być konieczne wylogowanie się i ponowne zalogowanie, aby system (część systemu nie był pewien) rozpoznać, że należysz do grupy "dialout". Jeśli nie masz pewności, sprawdź komendę groups (1).
  1414.  
  1415. Podłącz modem USB, jeśli jeszcze tego nie zrobiłeś. Nie jako root, ale jako użytkownik, podaj polecenie "wvdial" w wierszu poleceń terminala. Jeśli wszystko pójdzie dobrze, powinno to połączyć cię z Internetem przez twoją sieć komórkową. Później naciśnij klawisz <Ctrl-C>, aby rozłączyć.
  1416.  
  1417. Podano, że pakiet "usb-modeswitch" może być niezbędny, jeśli modem USB nie był wcześniej używany. Pisarz nie spotkał się ani nie wypróbował omawianej okoliczności.
  1418.  
  1419. Aby stwierdzić oczywiste: procedura powinna działać tylko wtedy, gdy zapłaciłeś subskrypcję do sieci komórkowej.
  1420.  
  1421. Nie twierdzi się, że procedura była możliwie najłagodniejsza, ale procedura ma zaletę, że jest względnie oczywista w działaniu. Udoskonalony użytkownik może udoskonalić dane.
  1422.  
  1423. FAQ
  1424.  
  1425. Jak włączyć "Udostępnianie połączenia internetowego"?
  1426.  
  1427. A) Ponieważ jądro 2.6 jest głównym strumieniem, itp. Omówię tylko IPTables i Kernel 2.6. Zakładam również, że ppp0 to twój modem, a eth0 to twój lan.
  1428. Po pierwsze - musimy dodać pewne reguły do ​​iptables - uruchom następujące polecenia:
  1429.  
  1430. # Spowoduje to WYCZYŚĆ WSZYSTKIE ZASADY !!!
  1431. iptables -F
  1432. #Włącz NAT (przez interfejs ppp0)
  1433. iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
  1434.  
  1435. # następnie musimy włączyć routing:
  1436. echo "1"> / proc / sys / net / ipv4 / ip_forward
  1437.  
  1438. To powinno zrobić - od tego można dodawać reguły, aby blokować przychodzące połączenia itp.
  1439. Moja karta jest uszkodzona / odpowiada "BŁĄD" na wszystkie polecenia
  1440. A) Nie wysłałeś kodu PIN na kartę - dodaj polecenie "pin" lub wyłącz PIN na karcie SIM
  1441. Moja karta Novatel działa bardzo wolno - +800 razy na sekundę
  1442.  
  1443. A) Spróbuj uruchomić "setserial -a / dev / ttyS1 low_latency spd_warp" - zastąp / dev / ttyS1 swoim portem
  1444. Kiedy już masz polecenie setserial, wstaw je do /etc/ppp/ip-up.local - spowoduje to uruchomienie komendy za każdym razem, gdy połączenie zostanie nawiązane.
  1445. Co oznaczają wszystkie sekcje wvdial?
  1446. Domyślne - co zrobić, jeśli nic nie jest wybrane (zawsze dołączone)
  1447. pin - wyślij swoja pinezkę do karty
  1448. novatel - wybierz kartę novatel
  1449. opcja - wybierz kartę opcji
  1450. hsdpa - Opcja karty HSDPA
  1451. e1000 - wybierz E1000 przez USB
  1452. na pokładzie - wybierz modem pokładowy mojego notebooka
  1453. internet - wybierz APN Internetu
  1454. internetvpn - wybierz APN Internetu
  1455. myapn - wybierz swój apn
  1456. 384k, 144k, 64k - wybierz szybkość połączenia 3G
  1457. 2 gonly - wybierz tylko GPRS
  1458. 3 gonly - wybierz tylko 3G
  1459. Jak mogę zobaczyć użycie pod Linuksem?
  1460.  
  1461. Zadanie Linux
  1462.  
  1463. DO ZROBIENIA
  1464.  
  1465. Niech karta opcji wywoła sama "modprobe usbserial"
  1466. Spraw, aby karta Novatel zarejestrowała drugi port pod Linuksem
  1467. Wykonaj badania poziomów sygnałów zgłoszonych przez + CSQ
  1468. Uzyskaj PIN do pracy z wvdial i Novatel
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486. #################################################################################
  1487. #################################################################################
  1488. #################################################################################
  1489.  
  1490.  
  1491.  
  1492.  
  1493. HowTo Connect your Laptop to Internet using a Cell Phone via USB or Bluetooth
  1494.  
  1495. In this article I am going to describe how to easily connect your laptop to the internet using your cell phone as a 3G/GPRS modem via bluetooth or USB.
  1496.  
  1497. The procedure has been tested in a Toshiba Satellite Laptop with Debian SID (2.6.26-1-686) and a Nokia N80 Cell Phone connected to the Spanish mobile net Movistar. Surely you must slightly change the parameters given in this paper to make a different connection work...
  1498.  
  1499. It is very important to follow strictly all of the steps related in this article.
  1500.  
  1501. Note: For general information on setting up Bluetooth, also see the page BluetoothUser.
  1502.  
  1503. Pairing your Laptop with your Cell Phone
  1504.  
  1505. First of all, you need to pair your laptop with your cell phone. You need an active internet connection to your laptop in order to download some packages. We will use the kdebluetooth package. Though I myself am a Gnome user, I have found this package very useful. So that let us open a console and type as root:
  1506.  
  1507. # apt-get install kdebluetooth
  1508.  
  1509. This will install the package. After that, just let us type as a normal user:
  1510.  
  1511. $ kbluetooth
  1512.  
  1513. Then a little blue icon will appear on the taskbar...
  1514.  
  1515. If we click on it with the right button of the mouse and choose the option CONFIGURE... ADAPTERS... then we will be able to configure the laptop in order to set it in DISCOVERABLE mode...
  1516.  
  1517. After this, we activate the Bluetooth on the cell phone and try to detect the laptop... Once discovered the laptop on the phone, it will prompt us to enter a numeric password: just type something easy like "123" in case you think there is no security threat... (It is just a one-time password). You will be prompted to repeat the same password on your laptop. To avoid repeating this process each time you pair your laptop with your cell phone, I highly recommend to add the laptop as a trusted device (this is an option easily accessible in the bluetooth menu on the cell phone)... Et voi-là... our devices are just paired!
  1518.  
  1519. Configuring MODEM Parameters
  1520.  
  1521. Now we need to configure the modem parameters of your cell phone.
  1522.  
  1523. First connect the cell phone to the laptop computer with the USB cable... It is important that the cell phone does not lose connectivity at this point, so that it would be useless if you connected your cell phone via USB in the "File Transfer" mode... You need to connect it in a way that the cell phone is still operative. In the case of the Nokia N80 you should choose the "PC-Suite" option...
  1524.  
  1525. And then type as root:
  1526.  
  1527. # apt-get install wvdial
  1528. # wvdialconf
  1529.  
  1530. After doing this, wvdialconf has examined your cell phone and after a successful connection with it has determined the correct parameters of your modem and written it to a file. But now we must tweak this configuration file, so that we type as root:
  1531.  
  1532. # apt-get install gedit
  1533. # gedit /etc/wvdial.conf
  1534.  
  1535. You need to delete the following lines of code:
  1536.  
  1537. Modem Type = USB Modem
  1538. Modem = /dev/ttyACM0
  1539.  
  1540. And you need to add the following lines to the end of the file we are editing in the same order as it appears here:
  1541.  
  1542. New PPPD = yes
  1543. Phone = *99***1#
  1544. Username = MOVISTAR
  1545. Password = MOVISTAR
  1546. Init6= AT+CGDCONT=1,"IP","movistar.es"
  1547.  
  1548. [Dialer usb-scb]
  1549. Modem Type = USB Modem
  1550. Modem = /dev/ttyACM0
  1551.  
  1552. [Dialer blz-scb]
  1553. Modem = /dev/rfcomm0
  1554.  
  1555. Now we save the file without changing name nor location and we are ready. The cell phone modem is completely configured, and we can use it indistinctly via USB or Bluetooth (as you prefer) without changing any parameter...
  1556.  
  1557. Bringing Down the Network
  1558.  
  1559. Before connecting your laptop to your cell phone, we first need to bring down your existing network connection. To do that, we type as root:
  1560.  
  1561. # ifconfig eth0 down
  1562. # mv /etc/resolv.conf /etc/resolv.conf.eth0
  1563.  
  1564. And eth0 is the name of your active network interface. In case you are not sure about the name of your interface, just type as root:
  1565.  
  1566. # ifconfig
  1567.  
  1568. So that all active interfaces will appear...
  1569.  
  1570. DNS settings
  1571.  
  1572. To use the internet, you will need correct DNS settings. Normally, you will automatically get DNS settings when you connect, so you do not need to do anything.
  1573.  
  1574. However, if your cellular network requires it, you may have to set the DNS servers manually. To do this:
  1575.  
  1576. # echo "nameserver 194.179.1.100" > /etc/resolv.conf
  1577. # echo "nameserver 194.179.1.101" >> /etc/resolv.conf
  1578.  
  1579. The examples nameservers are valid only if you are connecting to the Spanish mobile net Movistar... consult your cellular network's documentation for the right settings.
  1580.  
  1581. Connecting via USB
  1582.  
  1583. If you want to connect your laptop to the internet via USB to your cell phone. Just connect the cables and type as root:
  1584.  
  1585. # wvdial usb-scb&
  1586.  
  1587. You are done. You can surf the web, or check your e-mail... ;-)
  1588.  
  1589. Connecting via Bluetooth
  1590.  
  1591. If you want to connect your laptop to the internet via Bluetooth to your cell phone. Just activate bluetooth both in the laptop and the cell phone, and then type as root:
  1592.  
  1593. # hcitool scan
  1594.  
  1595. The following information will appear:
  1596.  
  1597. Scanning...
  1598. 00:11:22:33:44:55 NameDevice
  1599.  
  1600. This is the MAC address and the name assigned to your cell phone Bluetooth device. Now you type as root (using the same MAC address as above):
  1601.  
  1602. # rfcomm connect 0 00:11:22:33:44:55 2&
  1603.  
  1604. After the connection is established, you type as root:
  1605.  
  1606. # wvdial blz-scb&
  1607.  
  1608. You are done. You can surf the web, or check your e-mail... ;-)
  1609.  
  1610.  
  1611.  
  1612.  
  1613. ---------------------------------------------------------------------
  1614. PomocSpisTreści
  1615.  
  1616. Hardware Support
  1617. Installation with PPP and /etc/network/interfaces
  1618. Advanced Installation with WVDial
  1619. For Novatel
  1620. For Option
  1621. Extra Steps for the HSDPA card
  1622. Extra steps for the Novatel U740 Card
  1623. Extra Steps for the Huawei Cards
  1624. Huawei E169
  1625. Huawei E220
  1626. Notes
  1627. How to connect using a Franklin U210 USB wireless/WAN/mobile broadband modem
  1628. FAQ
  1629. TODO
  1630. Resources
  1631. External Links
  1632.  
  1633. Hardware Support
  1634.  
  1635. The following cards/phones works 100% with next scripts/configs:
  1636.  
  1637. BandLuxe C100
  1638. Huawei/E176 (works out of the box)
  1639.  
  1640. Huawei/E169 works without any problems
  1641.  
  1642. Huawei/E220
  1643. Huawei/E620
  1644.  
  1645. Huawei/K3565-Z
  1646. Motorola E1000
  1647. Nokia 6680 (just don't set the speed/service - no 3gonly and 384k configs)
  1648.  
  1649. Nokia N80 (with a nice How-To UseYourCellPhoneAsModem)
  1650. Novatel HSDPA Card
  1651. Novatel Merlin U630
  1652. Option Fusion
  1653. Option HSDPA Card
  1654. Option Quad
  1655.  
  1656. Installation with PPP and /etc/network/interfaces
  1657.  
  1658. This works with Debian Wheezy 7.
  1659.  
  1660. Install the packages netbase, ifupdown, and ppp if you don't have them already:
  1661.  
  1662. apt-get install netbase ifupdown ppp
  1663.  
  1664. Create a file /etc/ppp/peers/gprs with this content:
  1665.  
  1666. user "YOUR_USERNAME"
  1667. connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T YOUR_APN"
  1668. /dev/ttyUSB0
  1669. noipdefault
  1670. defaultroute
  1671. replacedefaultroute
  1672. hide-password
  1673. #lcp-echo-interval 30
  1674. #lcp-echo-failure 4
  1675. noauth
  1676. persist
  1677. #mtu 1492
  1678. #maxfail 0
  1679. #holdoff 20
  1680. usepeerdns
  1681. #Optional, make it always appear as ppp2:
  1682. #unit 2
  1683.  
  1684. Then edit /etc/ppp/chap-secrets and add at the end:
  1685.  
  1686. "YOUR_USERNAME" * "YOUR_PASSWORD"
  1687.  
  1688. Similarly, edit /etc/ppp/pap-secrets and add at the end:
  1689.  
  1690. "YOUR_USERNAME" * "YOUR_PASSWORD"
  1691.  
  1692. Then edit /etc/network/interfaces and add the following:
  1693.  
  1694. auto gprs
  1695. iface gprs inet ppp
  1696. provider gprs
  1697.  
  1698. That's all you need most of the time. The connection will be brought up at boot, you can start it with ifup gprs or stop it with ifdown gprs.
  1699.  
  1700. Advanced Installation with WVDial
  1701.  
  1702. You need to download the new wvdial.conf for the HSDPA stuff to work !!!
  1703.  
  1704. This was originally written for Gentoo Linux which compiles everything from source. As a result of things might be a bit different, but we can work around it. Firstly, we need to get Linux to detect your card, start your PCMCIA services - normally this can be done using (most distros do this for you):
  1705.  
  1706. Before you insert your card, open a console/switch to an open console and as root run the following :
  1707.  
  1708. invoke-rc.d pcmciautils start
  1709.  
  1710. This will allow you to "see" what Linux is doing :
  1711.  
  1712. tail -f /var/log/messages
  1713.  
  1714. Right, now insert your card and you should see some stuff happening. I have included log traces of what the two cards "look" like under /var/log/messages in the attachment section.
  1715.  
  1716. If you see only the option_insert_nousb.txt messages using an option card run the following command:
  1717.  
  1718. modprobe usbserial vendor=0x0af0 product=0x5000
  1719.  
  1720. If you had to run the above command, you will need to save the vmc_g file attached into /etc/modules.d.
  1721.  
  1722. Now we need to find out where your card is - you will see in the messages where the card is - /dev/ttyS* for Novatel or /dev/ttyUSB* for Option:
  1723.  
  1724. find /dev/ | grep ttyS
  1725.  
  1726. Should show /dev/ttyS0 or /dev/ttyS1 for a Novatel Card.
  1727.  
  1728. find /dev/ | grep ttyUSB
  1729.  
  1730. Should show /dev/ttyUSB0 and USB1 and USB2 for an Option Card. (or /dev/tts/ttyUSB0-2 for udev)
  1731.  
  1732. Once we found that, we need to change /etc/wvdial.conf to match your settings, attached is my working wvdial.conf (this one is tested on GSM network Play in Poland, with e169 modem, but uses no specific options so should be very portable). The file is:
  1733.  
  1734. [Dialer Defaults]
  1735. Modem = /dev/ttyUSB0
  1736. Baud = 3600000
  1737. Init1 = ATZ
  1738. Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
  1739. Phone = *99#
  1740. Username = ppp
  1741. Password = ppp
  1742. Ask Password = 0
  1743. Dial Command = ATDT
  1744. Stupid Mode = 1
  1745. Compuserve = 0
  1746. Idle Seconds = 0
  1747. ISDN = 0
  1748. Auto DNS = 1
  1749.  
  1750. It is possible to set the PIN that is sent to modem to unlock SIM card, how ever this example does not use this option (you should search for it). Some SIM cards do not need the PIN to work as modems.
  1751.  
  1752. Now we can start dialing up.
  1753.  
  1754. For Novatel
  1755.  
  1756. wvdial novatel internet 3gonly 384k
  1757.  
  1758. For Option
  1759.  
  1760. wvdial option internet 3gonly 384k
  1761.  
  1762. If you need to send your PIN, add "pin" infront of all the commands, e.g.
  1763.  
  1764. wvdial pin novatel internet 3gonly 384k
  1765.  
  1766. Once your connection is up - surf away Now you can setup things like KPPP and Gnome's Modem Lights to do your dialing for you.
  1767.  
  1768. Extra Steps for the HSDPA card
  1769.  
  1770. Download the kernel module from the link below. Extract it to a directory somewhere safe.
  1771.  
  1772. Compile the driver using the following commands:
  1773.  
  1774. make clean && make
  1775.  
  1776. Once this is done, run the following command to insert the module into the kernel
  1777.  
  1778. insmod nozomi.ko
  1779.  
  1780. Once you have done that, use the following command to setup the connection:
  1781.  
  1782. wvdial hsdpa
  1783.  
  1784. Extra steps for the Novatel U740 Card
  1785.  
  1786. Until I get time to update the files etc. our Novatel Linux Users out there can just type this command before using the normal dialing command:
  1787.  
  1788. modprobe usbserial vendor=0x1410 product=0x1400
  1789.  
  1790. OR
  1791.  
  1792. modprobe usbserial vendor=0x1410 product=0x1410
  1793.  
  1794. Using lsusb will show you the Vendor and Product ID's or cat /proc/bus/usb/devices will do the same.I will still add them into the FAQ but at least this should help for now
  1795.  
  1796. This will add the USB's like the 3G Option did - am I seeing a swap here ? - so just dial /dev/ttyUSB0 or so - check the logs
  1797.  
  1798. Extra Steps for the Huawei Cards
  1799.  
  1800. None really - just make sure usbserial is loaded and the card will come up on /dev/ttyUSB0 - check the logs again to confirm
  1801.  
  1802. If the card doesn't come up, unload usbserial and reload with the following command:
  1803.  
  1804. rmmod usbserial
  1805. modprobe usbserial vendor=0x12d1 product=0x1001
  1806.  
  1807. I am still trying to work on the USB only card, so at the moment, I don't know if it will work under Linux.
  1808.  
  1809. Huawei E169
  1810.  
  1811. Tested by rfree on Debian Wheezy with Polish operator Play. All works well:
  1812.  
  1813. make sure with stat /dev/ttyUSB0 that such device-file is (re)created when you connect the modem (and wait 10 seconds), the date of file should change.
  1814. if device-file is not created (or if something does not work) then force the modem to work as modem only instead as card-reader/memory, using:
  1815.  
  1816. rmmod usb_storage
  1817. modprobe usbserial vendor=0x0af0 product=0x5000 # (or adjust vendor and product
  1818. number to the ones you see in dmesg or lsusb when you look for your modem)
  1819.  
  1820. copy the attached example file wvdial.conf-e169 to /etc/wvdial.conf
  1821.  
  1822. run wvdial (install wvdial if you don't have it) - and should be done
  1823.  
  1824. Huawei E220
  1825.  
  1826. I have found that this modem will only work with the short cable supplied...not the long one with two plugs...*shrug*
  1827.  
  1828. Same as the E620, except use the following modprobe command:
  1829.  
  1830. rmmod usb-storage
  1831. modprobe usbserial vendor=0x12d1 product=0x1003
  1832.  
  1833. (Some have reported an ID of 0x1001 - use lsusb to confirm) After that, you will notice only one USB serial coming up, then, remove the device and re-attach it, you shouldn't need to re-insert usbserial.
  1834.  
  1835. Notes
  1836.  
  1837. I have only seen 3G speeds on this device, but I think it is because of my RF conditions and location. More on this to follow...
  1838.  
  1839. How to connect using a Franklin U210 USB wireless/WAN/mobile broadband modem
  1840.  
  1841. Though this section needs work, it documents how one Debian user connects to the Internet over NTelos' cellular network in the United States using a Franklin CDMA EV-DO U210 USB modem. NTelos uses Sprint's network, and moreover it would appear that Franklin's U210 is the base model of Franklin's U-series (U210, U600, U601, U602, U770, U772), so there is a reasonably good chance that you can use this information even if your situation differs somewhat from the writer's -- but, as they say, your mileage may vary.
  1842.  
  1843. This advice is targeted to the beginning-to-intermediate user. Advanced users are challenged to edit the wiki to improve the advice.
  1844.  
  1845. Your Franklin USB modem presents itself to the wireless network as though it were a cell phone. It has a phone number. To connect, it calls another phone number. On NTelos' (and presumably also on Sprint's) network in the United States, the phone number your USB modem must call is "#777". You need not, but probably can, discover your USB modem's own phone number by logging into your account on your cellular provider's website. The only number you need today however is the "#777".
  1846.  
  1847. As root or via sudo(1), install the Debian package "wvdial", for instance by
  1848.  
  1849. $ sudo apt-get install wvdial
  1850.  
  1851. If desired, save the original state of /etc/wvdial.conf using RCS's ci(1) or the like (you can ignore this advice re RCS if you neither know nor care what it is about). Edit /etc/wvdial.conf to look something like this:
  1852.  
  1853. [Dialer Defaults]
  1854. Stupid Mode = true
  1855. Init1 = ATZ
  1856. Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
  1857. Modem Type = USB Modem
  1858. Baud = 460800
  1859. New PPPD = yes
  1860. Modem = /dev/ttyACM0
  1861. ISDN = 0
  1862. Phone = #777
  1863. Password = <Your Password>
  1864. Username = <Your Login Name>
  1865.  
  1866. The important lines are the "Stupid Mode = true" and the "Phone = #777". You need not fill in a password or username.
  1867.  
  1868. Edit "/etc/group" [again after using ci(1) first if you wish] to change
  1869.  
  1870. dialout:x:20:
  1871.  
  1872. to
  1873.  
  1874. dialout:x:20:foo
  1875.  
  1876. typing your username in place of "foo".
  1877.  
  1878. At this point, you may need to log out and log back in to get the system (which part of the system? not sure) to recognize that you now belong to the "dialout" group. If unsure, check with the groups(1) command.
  1879.  
  1880. Plug in your USB modem if you have not already done so. Not as root but as yourself, give the command "wvdial" at the terminal's command line. If all goes well, this should connect you to the Internet over your cellular network. Later, press <Ctrl-C> to disconnect.
  1881.  
  1882. One is given to understand that the "usb-modeswitch" package may be necessary if your USB modem has not been used before. The writer has neither met nor tested the circumstance in question.
  1883.  
  1884. To state the obvious: the procedure should be expected to work only if you have paid a subscription to the cellular network.
  1885.  
  1886. It is not asserted that the procedure were the smoothest possible, but the procedure does have the virtue of being relatively obvious in its operation. Refinements may occur to the interested user.
  1887.  
  1888. FAQ
  1889.  
  1890. How do I enable "Internet Connection Sharing" ?
  1891.  
  1892. A) Since the 2.6 kernel is main stream etc. I will only cover IPTables and Kernel 2.6. I am also assuming that ppp0 is your dialup and eth0 is your lan.
  1893. Firstly - we need to add some rules to iptables - run the following commands:
  1894.  
  1895. #This will CLEAR ALL RULES !!!
  1896. iptables -F
  1897. #Enable NAT (through the ppp0 interface)
  1898. iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
  1899.  
  1900. #then we need to enable routing:
  1901. echo "1" > /proc/sys/net/ipv4/ip_forward
  1902.  
  1903. That should do it - from here you can add rules to block incomming connections etc.
  1904. My card is broken/replies "ERROR" to all the commands
  1905. A) You didn't send your PIN to the card - either add the "pin" command or disable the PIN on the SIM
  1906. My Novatel card is very slow - +-800 bytes per second
  1907.  
  1908. A) Try running "setserial -a /dev/ttyS1 low_latency spd_warp" - replace /dev/ttyS1 with your port
  1909. Once you have your setserial command, insert it into /etc/ppp/ip-up.local - this will cause the command to be ran everytime a connection is made.
  1910. What does all the wvdial sections do/mean ?
  1911. Defaults - What to do if nothing is selected (Always included)
  1912. pin - send your pin to the card
  1913. novatel - select the novatel card
  1914. option - select the option card
  1915. hsdpa - Option HSDPA card
  1916. e1000 - select the E1000 via USB
  1917. onboard - select the onboard modem of my notebook
  1918. internet - select the internet APN
  1919. internetvpn - select the internetvpn APN
  1920. myapn - select your apn
  1921. 384k,144k,64k - select the speed of your 3G connection
  1922. 2gonly - select GPRS only
  1923. 3gonly - select 3G only
  1924. How do I see the usage under Linux ?
  1925.  
  1926. ToDo Linux Usage
  1927.  
  1928. TODO
  1929.  
  1930. Make the Option card call "modprobe usbserial" by itself
  1931. Make the Novatel card register the second port under Linux
  1932. Do some research into the signal levels reported via +CSQ
  1933. Get the PIN to work with wvdial and Novatel
  1934.  
  1935. Resources
  1936.  
  1937. Modem/3G/Cards
  1938.  
  1939. Modem/3G/FAQ
  1940.  
  1941. Modem/3G/Vodafone
  1942.  
  1943. External Links
  1944.  
  1945. http://www.peck.org.uk/GlobeTrotterGPRShowto.html - GPRS HowTo
  1946.  
  1947. Vodafone_Mobile_Connect_USB_Modem
  1948.  
  1949. http://markus.wernig.net/en/it/usb-serial-handy-ppp.phtml - How to connect a cell phone via USB to a Linux laptop and dial-up an internet connection.
  1950.  
  1951. Hardware | Modem
  1952.  
  1953. Modem/3G (ostatnio modyfikowane 2018-02-01 16:12:30)
  1954.  
  1955. MoinMoin PoweredPython PoweredDebian Wiki team, bugs and config available.Hosting provided by Metropolitan Area Network Darmstadt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement