3G Интернет на Cisco 881

Конфигурируем 3G модем для Cisco (на примере Sierra Wireless 880E-G).
Сначала нужно создать профиль соединения (тоесть APN логин и пароль)
делается это так (не из глобальной конфигурации а из enable)

Router#cellular 0 gsm profile create 3 fixedip.nw chap megafon megafon

Далее нужно настроить интерфейс cellular - у меня это cellular 0

Router#conf t
Router(config)#interface cellular 0
Router(config-if)#encapsulation ppp
Router(config-if)#ppp chap hostname megafon
Router(config-if)#ppp chap password megafon
Router(config-if)#ppp ipcp dns request
Router(config-if)#async mode interactive
Router(config-if)#ip address negotiated

Router(config)#chat-script MEGAFON "" "ATD*99*3#" TIMEOUT 30 CONNECT
Тут 3 - это номер профиля который мы создали выше.

Router(config)#interface cellular 0
Router(config-if)#dialer string MEGAFON

Ищем линию связанную с модемом:
Router#sh line
   Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int
*     0 CTY              -    -      -    -    -      0       0     0/0       -
      1 AUX      0/0     -    -      -    -    -      0       0     0/0       -
I     3 TTY              -    -      -    -    -      0       0     0/0     Ce0
      8 VTY              -    -      -    -    -      0       0     0/0       -
      9 VTY              -    -      -    -    -      0       0     0/0       -
     10 VTY              -    -      -    -    -      0       0     0/0       -
     11 VTY              -    -      -    -    -      0       0     0/0       -
     12 VTY              -    -      -    -    -      0       0     0/0       -

У меня это line 3

Router(config)#line 3
Router(config-line)#script dialer MEGAFON
Router(config-line)#modem inOut
Router(config-line)#no exec
Router(config-line)#exec-timeout 0 0

Теперь нам еще понадобится ACL в котором будет указан траффик который должен попадать в dialer.

Router(config)#access-list 1 permit any
Router(config)#dialer-list 1 protocol ip list 1

И теперь этот dialer-list указать в интерфейсе.

Router(config)#interface cellular 0
Router(config-if)#dialer-group 1

Далее на него нужен маршрут, наверное с указанием веса, так как врядли это единственный маршрут, пусть будет так:

Router(config)#ip route 0.0.0.0 0.0.0.0 cellular 0 200

Ну и в заключении NAT:

Router(config)#ip access-list extended NATACL
Router(config-ext-nacl)#permit ip 192.168.0.0 0.0.0.255 any

Router(config)#ip nat inside source list NATACL interface cellular 0 overload

Router(config)#interface cellular 0
Router(config-if)#ip nat outside

Теперь дело за проверкой.
Router#sh int cellular 0
Cellular0 is up, line protocol is up
  Hardware is 3G Modem-HSPA/UMTS/EDGE/GPRS-850/900/1800/1900/2100MHz / Global
  Description: uplink
  Internet address is 100.87.93.139/32
  MTU 1500 bytes, BW 2000 Kbit/sec, DLY 100000 usec,
     reliability 255/255, txload 4/255, rxload 18/255
  Encapsulation PPP, LCP Open
  Open: IPCP, loopback not set
  Keepalive not supported
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/10 (size/max)
  5 minute input rate 142000 bits/sec, 20 packets/sec
  5 minute output rate 34000 bits/sec, 19 packets/sec
     6426 packets input, 6566728 bytes, 0 no buffer
     Received 0 broadcasts (0 IP multicasts)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     5176 packets output, 1089212 bytes, 0 underruns
     0 output errors, 0 collisions, 2 interface resets
     0 unknown protocol drops
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up

Router#sh cellular 0 network
Current Service Status = Normal, Service Error = None
Current Service = Combined
Packet Service = HSDPA (Attached)
Packet Session Status = Active
Current Roaming Status = Home
Network Selection Mode = Automatic
Country = RUS, Network = MegaFon
Mobile Country Code (MCC) = 250
Mobile Network Code (MNC) = 2
Location Area Code (LAC) = 7806
Routing Area Code (RAC) = 39
Cell ID = 40740
Primary Scrambling Code = 419
PLMN Selection = Automatic
Registered PLMN =  , Abbreviated =

Service Provider = MegaFon

Ну и в заключении весь тестовый конфигурациооный файл:
(там нет профиля, он храниться на модеме, Router#cellular 0 gsm profile create 3 fixedip.nw chap megafon megafon).

!
! Last configuration change at 10:14:00 UTC Tue Mar 25 2014
version 15.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
!
aaa new-model
!
!
!
!
!
!
!
aaa session-id common
!
memory-size iomem 10
ip auth-proxy max-login-attempts 5
ip admission max-login-attempts 5
!
!
!
!
ip dhcp pool DPOOL
 network 192.168.0.0 255.255.255.0
 default-router 192.168.0.1 
 dns-server 8.8.8.8 8.8.4.4 
!
!
ip cef
no ipv6 cef
!
!
multilink bundle-name authenticated
chat-script MEGAFON "" "ATD*99*3#" TIMEOUT 30 CONNECT
!
!
!
!
!
!
controller Cellular 0
!
!
!
!
!
interface FastEthernet0
 no ip address
 spanning-tree portfast
!
interface FastEthernet1
 no ip address
 spanning-tree portfast
!
interface FastEthernet2
 no ip address
 spanning-tree portfast
!
interface FastEthernet3
 no ip address
 spanning-tree portfast
!
interface FastEthernet4
 no ip address
 duplex auto
 speed auto
!
interface Cellular0
 description uplink
 ip address negotiated
 ip nat outside
 ip virtual-reassembly in
 encapsulation ppp
 dialer in-band
 dialer idle-timeout 0
 dialer string "*99*3#"
 dialer string MEGAFON
 dialer-group 1
 async mode interactive
 ppp chap hostname megafon
 ppp chap password 0 megafon
 ppp ipcp dns request
!
interface Vlan1
 ip address 192.168.0.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly in
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
ip nat inside source list NATACL interface Cellular0 overload
ip route 0.0.0.0 0.0.0.0 Cellular0 200
!
ip access-list extended NATACL
 permit ip 192.168.0.0 0.0.0.255 any
!
access-list 1 permit any
dialer-list 1 protocol ip list 1
!
!
!
!
control-plane
!
!
!
line con 0
line aux 0
line 3
 exec-timeout 0 0
 script dialer MEGAFON
 modem InOut
 no exec
 rxspeed 7200000
 txspeed 2000000
line vty 0 4
 transport input all
!
!
end

Комментарии

Популярные сообщения