Router Installation and Configuration Manual/Configuring an ADSL Interface

From ImageStream Router Documentation

< Router Installation and Configuration Manual
Revision as of 00:38, 6 June 2009 by Syoder (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Advanced Configuration Examples

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

  • Four ADSL interfaces
  • Four Ethernet VLANs
  • Each VLAN may only transmit on one ADSL interface
  • Each VLAN must provide DHCP server services
  • Each ADSL interface must source NAT for its VLAN
  • PPPoA using VC-Mux encapsulation (no LLC/SNAP headers)
  • If PPPoA with LLC/SNAP headers is required change the encapsulation aal5mux ppp to encapsulation aal5snap

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 aal5mux ppp
  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