Hugo van der Kooij: Network: Cisco 836 with XS4ALL

NEDERLANDS | ENGLISH

This document will describe how to get a Cisco 836 router operational with XS4ALL. The Cisco 836 is a ADSL over ISDN router (Annex-B) and just about anything listed should work on the Cisco 837 or other routers. I have select this router based on the following criteria: IPv6, SNMP, SYSLOG, ACL's and an understandable user interface. (I just happen to hate those braindead menu interfcaes like you're stuck with on Zyxel and other el-cheapo routers.)

Preparation
  1. Make sure your terminal emulation is set to 9600,8N1. The first part of your config needs to be done on the console.
  2. Do not start with the default install. But define your own setup step by step.
  3. You have a working DSL link.

Basics
  1. Give it a hostname anfalas and use it in the domain hugo.vanderkooij.org. Login to the unit and go to the config mode (conf t). More details must be retrieved from the Cisco manual(s) if you do not know how to do this. I will not bother to answer basic questions you can find in the manual.
    hostname anfalas
    ip domain name hugo.vanderkooij.org
    ip name-server 192.168.1.2
    
  2. Setup authentication with username and password and an enable secret.
    aaa new-model
    aaa authentication login default local
    aaa session-id common
    username my-account secret my-secret
    enable secret enable-secret
    line con 0
     no modem enable
     transport output none
    line aux 0
    line vty 0 4
     transport output none
    

    Do not allow telnet or ssh sessions from your router!

  3. Enable SSH (Just version 2)
    crypto key generate rsa
    ip ssh timeout 60
    ip ssh version 2
    
  4. Disable unneeded (and insecure) services
    no ip finger
    no ip http server
    no ip http secure-server
    no cdp run
    no ftp-server write-enable
    no service tcp-small-servers
    no service udp-small-servers
    

Configure your LAN
  1. Ethernet
    interface Ethernet0
     no shutdown
     ip address 192.168.1.1 255.255.255.0
     ip nat inside
     no cdp enable
    
  2. DHCP server (NO TESTED!)
    ip dhcp pool ipv4-dhcp
       network 192.168.1.0 255.255.255.0
       subnet prefix-length 24
       default-router 192.168.1.1
       netbios-node-type h-node
       domain-name hugo.vanderkooij.org
       dns-server 192.168.1.2
    ip bootp server
    interface Ethernet0
     ip dhcp server ipv4-dhcp
    

Configure internet
  1. Setup ATM (KPN DSL networks only!)
    template adsl
    interface ATM0
     no shutdown
     no ip address
     load-interval 30
     no atm ilmi-keepalive
     dsl operating-mode auto
     pvc 8/48
      encapsulation aal5mux ppp dialer
      dialer pool-member 1
    
  2. Setup circuit
    interface Dialer0
     no shutdown
     ip address negotiated
     no ip unreachables
     no cdp enable
     ip nat outside
     ip virtual-reassembly
     encapsulation ppp
     dialer pool 1
     dialer idle-timeout 0
     dialer-group 1
     ppp pap sent-username XS4ALL-account@xs4all-basic-adsl password XS4ALL-password
    
  3. Enable your dialer interface
    dialer-list 1 protocol ip permit
    
  4. Enable routing
    ip subnet-zero
    ip classless
    ip cef
    
  5. Default gateway
    ip route 0.0.0.0 0.0.0.0 Dialer0
    
  6. NAT
    ip nat inside source list 100 interface Dialer0 overload
    access-list 100 permit ip 192.168.1.0 0.0.0.255 any
    

Services
As I run some services I must setup PAT to translate traffic for these ports.
  1. PAT
    ip nat inside source static tcp 192.168.1.2 25 interface Dialer0 25
    ip nat inside source static udp 192.168.1.2 53 interface Dialer0 53
    ip nat inside source static tcp 192.168.1.2 53 interface Dialer0 53
    ip nat inside source static tcp 192.168.1.2 80 interface Dialer0 80
    ip nat inside source static tcp 192.168.1.2 443 interface Dialer0 44
    
  2. More PAT (Dialer0:2022 -> server:22)
    ip nat inside source static tcp 192.168.1.2 22 interface Dialer0 2022
    

Shutting things down
Internet is a bad place to be so make sure you are protected. You will last only about 30 minutes without it.
  1. Access rule set
    ip access-list extended ipv4-inet-in
     permit icmp any any echo-reply
     permit icmp any any packet-too-big
     permit icmp any any time-exceeded
     permit icmp any any unreachable
     permit tcp any any eq 22 log
     permit tcp any any eq smtp
     permit udp any any eq domain
     permit tcp any any eq domain
     permit tcp any any eq www
     permit tcp any any eq 443
     permit 41 any any
     deny   ip any any log
    

    The access-group line for protocol 41 is for our IPv6 tunnel which we will build later.

  2. And use it on the internet interface
    interface Dialer0
     ip access-group ipv4-inet-in in
    
  3. IP inspection on. (After all you are paying for the firewall feature set.)
    ip inspect udp idle-time 3600
    ip inspect dns-timeout 60
    ip inspect tcp synwait-time 60
    ip inspect name ipv4-FireWall tcp
    ip inspect name ipv4-FireWall udp
    no ip inspect name ipv4-FireWall http
    ip inspect name ipv4-FireWall ftp
    no ip inspect name ipv4-FireWall esmtp
    ip inspect name ipv4-FireWall h323
    ip inspect name ipv4-FireWall skinny
    ip inspect name ipv4-FireWall icmp
    ip inspect name ipv4-FireWall fragment maximum 256 timeout 1
    ip inspect name ipv4-FireWall realaudio
    ip ips po max-events 100
    interface Ethernet0
     ip inspect ipv4-FireWall in
     ip inspect ipv4-FireWall out
    interface Dialer0
     ip inspect ipv4-FireWall in
     ip inspect ipv4-FireWall out
    

Please note that the quality of the IP inspection engine of Cisco is rather questionable. That is why I have disabled the (E)SMTP and HTTP engine parts. They are too much trouble to leave them enabled.

Logging and time
You need an accurate time for you logs and should log everyting to a syslog server.
  1. Set your timezone
    clock timezone CET 1
    clock summer-time CEST recurring last Sun Mar 2:00 last Sun Oct 3:00
    clock save interval 8
    
  2. Setup NTP
    ntp logging
    ntp server 194.109.22.18
    ntp server 193.67.79.202
    ntp server 194.109.20.18
    
  3. Turn on logging
    logging 192.168.1.2
    service timestamps debug datetime msec
    service timestamps log datetime msec localtime show-timezone
    
  4. Reduce logging on the console
    logging console warnings
    logging rate-limit console 5
    
  5. Log other issues
    security authentication failure rate 2 log
    logging count
    logging userinfo
    login on-failure log
    login on-success log
    
  6. SNMP traps
    snmp-server host 192.168.1.2 public
    snmp-server trap link ietf
    snmp-server contact Hugo van der Kooij <snmptraps@vanderkooij.org>
    snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
    snmp-server enable traps tty
    snmp-server enable traps cpu threshold
    
  7. Warning to users
    banner motd #
    ***************************************************************************
                                NOTICE TO USERS
    
    This computer system is the private property of the owner, whether
    individual, corporate or government.  It is for authorized use only.
    Users (authorized or unauthorized) have no explicit or implicit
    expectation of privacy.
    
    Any or all uses of this system and all files on this system may be
    intercepted, monitored, recorded, copied, audited, inspected, and
    disclosed to your employer, to authorized site, government, and law
    enforcement personnel, as well as authorized officials of government
    agencies, both domestic and foreign.
    
    By using this system, the user consents to such interception, monitoring,
    recording, copying, auditing, inspection, and disclosure at the
    discretion of such personnel or officials.  Unauthorized or improper use
    of this system may result in civil and criminal penalties and
    administrative or disciplinary action, as appropriate. By continuing to
    use this system you indicate your awareness of and consent to these terms
    and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the
    conditions stated in this warning.
    
    ****************************************************************************
    #
    
  8. Blocking of SSH worms
    login block-for 300 attempts 1 within 300
    login delay 1
    login quiet-mode access-class ssh-clients
    ip access-list extended ssh-clients
     remark -- Only local net remains after login failure ---------
     permit tcp 192.168.0.0 0.0.255.255 any eq 22 log
     remark -- Drop and log all other SSH attempts ----------------
     deny   tcp any any eq 22 log
     remark -- DONE -----------------------------------------------
    

IP version 6
make sure you did setup your tunnel at XS4ALL first. If you use SixXS NET then you need to follow their procedures.
  1. Ethernet
    interface Ethernet0
     ipv6 enable
     ipv6 address 2001:888:10FA::EFFE/64
     ipv6 cef
     ipv6 nat
     ipv6 nd ra-interval 30
     ipv6 nd prefix 2001:888:10FA::/64 86400 86400
     ipv6 nd prefix FE80::/16 no-advertise
     ipv6 nd other-config-flag
     ipv6 dhcp server ipv6-dhcp rapid-commit preference 1
     ipv6 inspect ipv6-FireWall in
     ipv6 inspect ipv6-FireWall out
    

    Only a /64 subnetmask will result in a working IPv6 setup for your clients in accordance to the RFCs. But it is east to miss.

  2. Tunnel
    interface Tunnel0
     no ip address
     no ip unreachables
     ipv6 enable
     ipv6 address 2001:888:10:FA::2/64
     ipv6 cef
     ipv6 nat
     ipv6 traffic-filter ipv6-inet-in in
     ipv6 inspect ipv6-FireWall in
     ipv6 inspect ipv6-FireWall out
     tunnel source Dialer0
     tunnel destination 194.109.5.241
     tunnel mode ipv6ip
    
  3. Dialer
    Interface Dialer0
     ipv6 nat
    
  4. ACL
    ipv6 access-list ipv6-inet-in
     permit icmp host 2001:888:10:FA::1 host 2001:888:10:FA::2
     permit tcp any host 2001:888:10FA::1 eq 22 log
     permit tcp any host 2001:888:10FA::1 eq smtp log
     permit udp any host 2001:888:10FA::1 eq domain log
     permit tcp any host 2001:888:10FA::1 eq domain log
     permit tcp any host 2001:888:10FA::1 eq www log
     permit tcp any host 2001:888:10FA::1 eq 443 log
     permit icmp any 2001:888:10FA::/48 echo-reply log
     permit icmp any 2001:888:10FA::/48 unreachable log
     permit icmp any 2001:888:10FA::/48 time-exceeded log
     deny ipv6 any any log
    
  5. INSPECT
    ipv6 inspect udp idle-time 3600
    ipv6 inspect tcp synwait-time 60
    ipv6 inspect name ipv6-FireWall tcp
    ipv6 inspect name ipv6-FireWall udp
    ipv6 inspect name ipv6-FireWall icmp
    ipv6 inspect name ipv6-FireWall ftp timeout 3600
    
  6. DHCP
    ipv6 dhcp pool ipv6-dhcp
     prefix-delegation 2001:888:10FA::/64 00030001000D29EED13A
     dns-server 2001:888:10FA::1
     domain-name hugo.vanderkooij.org
    

    DHCP is not used to assign addresses anymore. So only the additional information needs to be handed out to the clients.

  7. Global
    ipv6 unicast-routing
    ipv6 cef
    ipv6 route 2000::/3 2001:888:10:FA::1
    ipv6 nat prefix 2001:888:10FA:FFFF:FFFF:FFFF::/96
    ipv6 nat v6v4 source list ipv6-local interface Dialer0 overload
    
  8. IPv6 NAT ACL
    ipv6 access-list ipv6-local
     permit ipv6 2001:888:10FA::/64 any
     permit ipv6 FE80::/10 any
     deny any any
    

In a nutshell:

  1. Define ethernet (your lan)
  2. Define ATM + dialer (your internet)
  3. Setup ACL's
  4. IPv6 tunnel works through your dialer interface. But the dialer interface itself only sees IPv4 data. (IP protocol 41)

Related documents:

This config is based on my Cisco 836 with firewall feature set. At present it runs 'Cisco IOS Software, C836 Software (C836-K9O3S8Y6-M), Version 12.3(11)T7, RELEASE SOFTWARE (fc3)' as it is the most recent version that still runs well in 48MB.

DISCLAIMER

  • Request for Cisco software will be completly ignored.
    You have to get it from the company that sold you the router!
  • Do not assume this setup is perfectly secure. You need to adept it to your unique situation. It is only intended to give you a reference.