Router Installation and Configuration Manual/Configuring an ADSL Interface

From ImageStream Router Documentation

(Difference between revisions)
Jump to: navigation, search
(Virtual router example emulating four ADSL routers using PPPoA and Ethernet VLANs)
Line 126: Line 126:
  !
  !
  interface Serial3.1
  interface Serial3.1
-
   encapsulation aal5mux ppp
+
   encapsulation aal5snap
   pvc 8/35
   pvc 8/35
  !
  !

Revision as of 01:13, 6 June 2009

Advanced Configuration Examples

Virtual router example emulating four ADSL routers using PPPoA and Ethernet VLANs

This example is designed to emulate the following multi-router setup on a single ImageStream router with a multi-port ADSL card:

  • Four stand-alone ADSL routers each with one ATM ADSL interface and one Ethernet port.
  • Each ADSL router provides DHCP server services to its Ethernet LAN.
  • Each ADSL router performs source Network Address Translation (SNAT) on the ADSL interface.
  • Ethernet switch with one port connected to each ADSL router.
  • Ethernet switch has one VLAN trunk port with one VLAN mapped to each ADSL router switch port.

Ethernet VLAN specifications:

  • Four Ethernet VLANs
VLAN Interface ADSL Interface VLAN IP Address VLAN DHCP Subnet
Ethernet1.10 ADSL0 192.168.10.1/24 192.168.10.0/24
Ethernet1.11 ADSL1 192.168.11.1/24 192.168.11.0/24
Ethernet1.12 ADSL2 192.168.12.1/24 192.168.12.0/24
Ethernet1.13 ADSL3 192.168.13.1/24 192.168.13.0/24
  • Each VLAN may only transmit on one ADSL interface
  • Each VLAN must provide DHCP server services

ADSL specifications:

  • Four ADSL interfaces:
ADSL Interface ATM Interface VPI/VCI ATM Encapsulation PPP Username VLAN Interface
ADSL0 Serial0.1 8/35 VC-Mux test1@imagestream.com Ethernet1.10
ADSL1 Serial1.1 8/35 VC-Mux test1@imagestream.com Ethernet1.11
ADSL2 Serial2.1 8/35 VC-Mux test1@imagestream.com Ethernet1.12
ADSL3 Serial3.1 8/35 SNAP/LLC test1@imagestream.com Ethernet1.13
  • Each ADSL interface must source NAT for its VLAN

wan.conf:

 interface Ethernet1
 !
 interface Ethernet1.10
  ip address 192.168.10.1 255.255.255.0
 !
 interface Ethernet1.11
  ip address 192.168.11.1 255.255.255.0
 !
 interface Ethernet1.12
  ip address 192.168.12.1 255.255.255.0
 !
 interface Ethernet1.13
  ip address 192.168.13.1 255.255.255.0
 !
 interface Serial0
  encapsulation atm
 !
 interface Serial0.1
  encapsulation aal5mux ppp
  pvc 8/35
 !
 interface Serial1
  encapsulation atm
 !
 interface Serial1.1
  encapsulation aal5mux ppp
  pvc 8/35
 !
 interface Serial2
  encapsulation atm
 !
 interface Serial2.1
  encapsulation aal5mux ppp
  pvc 8/35
 !
 interface Serial3
  encapsulation atm
 !
 interface Serial3.1
  encapsulation aal5snap
  pvc 8/35
 !
 interface ADSL0
  adsl device Serial0.1
  protocol pppoa
  ip address negotiated
  ppp pap sent-username test1@imagestream.com password mypass
 !
 interface ADSL1
  adsl device Serial1.1
  protocol pppoa
  ip address negotiated
  ppp pap sent-username test2@imagestream.com password mypass
 !
 interface ADSL2
  adsl device Serial2.1
  protocol pppoa
  ip address negotiated
  ppp pap sent-username test3@imagestream.com password mypass
 !
 interface ADSL3
  adsl device Serial3.1
  protocol pppoa
  ip address negotiated
  ppp pap sent-username test4@imagestream.com password mypass
 !
 # Link Ethernet0.10 to ADSL0
 ip rule add fwmark 0x10 table 10
 ip route add default dev ADSL0 table 10

 # Link Ethernet0.11 to ADSL1
 ip rule add fwmark 0x11 table 11
 ip route add default dev ADSL1 table 11

 # Link Ethernet0.12 to ADSL2
 ip rule add fwmark 0x12 table 12
 ip route add default dev ADSL2 table 12

 # Link Ethernet0.13 to ADSL3
 ip rule add fwmark 0x13 table 13
 ip route add default dev ADSL3 table 13
 !
 ip dhcp pool 0
  network 192.168.10.0 255.255.255.0
  ip dhcp excluded-address 192.168.10.1
  domain-name imagestream.com
  dns-server 211.52.5.55 205.159.243.2
  default-router 192.168.10.1
  lease 12 hours
 !
 ip dhcp pool 1
  network 192.168.11.0 255.255.255.0
  ip dhcp excluded-address 192.168.11.1
  domain-name imagestream.com
  dns-server 211.52.5.55 205.159.243.2
  default-router 192.168.11.1
  lease 12 hours
 !
 ip dhcp pool 2
  network 192.168.12.0 255.255.255.0
  ip dhcp excluded-address 192.168.12.1
  domain-name imagestream.com
  dns-server 211.52.5.55 205.159.243.2
  default-router 192.168.12.1
  lease 12 hours
 !
 ip dhcp pool 3
  network 192.168.13.0 255.255.255.0
  ip dhcp excluded-address 192.168.13.1
  domain-name imagestream.com
  dns-server 211.52.5.55 205.159.243.2
  default-router 192.168.13.1
  lease 12 hours
 !

rc.firewall:

 iptables -F -t nat

 # Ethernet0.10: Mark all incoming traffic with mark 0x10 and NAT outgoing traffic to the PPP address
 iptables -A PREROUTING -t mangle -i Ethernet0.10 -j MARK --set-mark 0x10
 iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -j MASQUERADE

 # Ethernet0.11: Mark all incoming traffic with mark 0x11 and NAT outgoing traffic to the PPP address
 iptables -A PREROUTING -t mangle -i Ethernet0.11 -j MARK --set-mark 0x11
 iptables -t nat -A POSTROUTING -s 192.168.11.0/24 -j MASQUERADE

 # Ethernet0.12: Mark all incoming traffic with mark 0x12 and NAT outgoing traffic to the PPP address
 iptables -A PREROUTING -t mangle -i Ethernet0.12 -j MARK --set-mark 0x12
 iptables -t nat -A POSTROUTING -s 192.168.12.0/24 -j MASQUERADE

 # Ethernet0.13: Mark all incoming traffic with mark 0x13 and NAT outgoing traffic to the PPP address
 iptables -A PREROUTING -t mangle -i Ethernet0.13 -j MARK --set-mark 0x13
 iptables -t nat -A POSTROUTING -s 192.168.13.0/24 -j MASQUERADE
Personal tools
Router software releases