WWW.DUMAIS.IO

AVR32 OS for NGW100Last edited on Feb 25, 2012

These pages are meant to describe the AVR32 architecture and how to do standalone development. This is basically a collection of notes that I am writting to help myself. Ususally I would do that in a text file on my computer but this time I said to myself "Why not share it with everyone?". It is hard to find information about this as everyone is talking about linux development everywhere. If you search on google, chances are that you will land on a forum where a guy asked the exact same question you were asking yourself and someone will have answered "Look on the internet" so you will be back to square one. So I decided to write my own web page as I learn to get my project going. Basically what I want to do is to build an OS for the NGW100 board.

Development is done in assembly language. It is easier to know what you are actually doing and it is more fun. You won't find a lot of resources on how to get you started with ASM for this CPU. Again, everyone is talking about Linux and C/C++, which is fine, but not usefull for what I am doing.

So I hope this information can be usefull to someone else. And if you see something wrong with what I am doing please tell me. I want this information to be accurate, and I want my OS to work.



That article does not exist

cisco router configurationLast edited on Feb 25, 2012

My private network is built around a cisco 2620xm router and a cisco catalyst 3448-XL My router's image is c2600-adventerprisek9-mz.124-25c.bin, and for the switch: c3500xl-c3h2s-mz.120-5.WC17.bin.

DSL connection

My router has a WIC-1ADSL card. Using this, I can connect with my ISP. Note that these settings might only work for my ISP (Teksavvy, in ottawa)

vpdn enable
no ip cef
interface ATM0/0
 no ip address
 atm restart timer 300
 no atm ilmi-keepalive
 bundle enable
 !
 dsl operating-mode auto
 hold-queue 224 in
 pvc 0/35
  pppoe-client dial-pool-number 1
 !
!
interface Dialer1
 ip address negotiated
 ip access-group 120 in
 ip mtu 1492
 ip nat outside
 ip nat enable
 ip virtual-reassembly
 encapsulation ppp
 ip tcp adjust-mss 1452
 dialer pool 1
 dialer-group 1
 no cdp enable
 ppp authentication pap callin
 ppp pap sent-username your_username password 0 your_password
 ppp ipcp dns request accept
 ppp ipcp address accept
!
ip forward-protocol nd
! set default route to go through Dialer1 interface
ip route 0.0.0.0 0.0.0.0 Dialer1

! deny telenet access from outside.
access-list 120 deny   tcp any any eq telnet
access-list 120 permit tcp any any
access-list 120 permit ip any any
dialer-list 1 protocol ip permit

With these settings, your DSL connection should come up. Any host from the outside of your network will be able to access TCP ports (except 23) on your network. More details on NAT will follow.

VLAN trunking

Consider the following configuration:
VLAN 1 hosts the 10.0.0.0/24 network
VLAN 3 hosts the 10.0.3.0/24 network
VLAN 10 hosts the 10.0.10.0/24 network
VLAN 1 and VLAN3 can talk to each other and to the WAN
VLAN 10 can only talk to the WAN

interface FastEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 10.0.0.1 255.255.255.0
 ip access-group 101 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 10.0.3.0 255.255.255.0
 ip access-group 103 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly
!
interface FastEthernet0/0.10
 encapsulation dot1Q 3
 ip address 10.0.10.0 255.255.255.0
 ip access-group 110 in
 no ip unreachables
 ip nat inside
 ip virtual-reassembly

A subinterface (ie: 0.10) defines a vlan. In this setup, interface 0 is configured to handle VLANs 1,3 and 10 by separating it in 3 different sub-interface. Note that with this configuration, nothing more needs to be done for inter-vlan routing. By assigning an IP paddress to subinterfaces, you tell the router how to route between vlans.

With this configuration, all 3 networks will be able to talk to each other. To prevent VLAN10 to talk to VLAN 1 and 3, you could do the following:

access-list 100 deny   ip 10.0.0.0 0.0.0.255 10.0.10.0 0.0.0.255
access-list 100 permit ip any any
access-list 100 permit udp any any

access-list 103 deny   ip 10.0.3.0 0.0.0.255 10.0.10.0 0.0.0.255
access-list 103 permit ip any any
access-list 103 permit udp any any

access-list 110 deny   ip 10.0.10.0 0.0.0.255 10.0.0.0 0.0.0.255
access-list 110 deny   ip 10.0.10.0 0.0.0.255 10.0.3.0 0.0.0.255
! deny telneting in gateway from guest network
access-list 110 deny   tcp 10.0.10.0 0.0.0.255 host 10.0.10.1 eq telnet
access-list 110 permit ip any any
access-list 110 permit udp any any

DHCP

The following configuration will setup a DHCP server on the router with a different pool for each networks.

! only hand out ip addresses from 10.0.0.100-10.0.0.149
ip dhcp excluded-address 10.0.0.1 10.0.0.99
ip dhcp excluded-address 10.0.0.150 10.0.0.255
! only hand out ip addresses from 10.0.3.100-10.0.3.149
ip dhcp excluded-address 10.0.3.1 10.0.3.99
ip dhcp excluded-address 10.0.3.150 10.0.3.255
! only hand out ip addresses from 10.0.10.100-10.0.10.149
ip dhcp excluded-address 10.0.10.1 10.0.10.99
ip dhcp excluded-address 10.0.10.150 10.0.10.255
ip dhcp pool pool_vlan1
   import all
   network 10.0.0.0 255.255.255.0
   default-router 10.0.0.1
   dns-server 10.0.0.1
ip dhcp pool pool_vlan3
   import all
   network 10.0.3.0 255.255.255.0
   default-router 10.0.3.1
   dns-server 10.0.3.1
ip dhcp pool pool_vlan10
   import all
   network 10.0.10.0 255.255.255.0
   default-router 10.0.10.1
   dns-server 10.0.10.1


DNS

To use the cisco router as a DNS forwarder, the following simple configuration can be usd

ip dns server

NAT / Port forwarding

I never got port range forwarding to work on my router. I ended up writing 100 lines for a range of 100 ports. But this is not shown here for for sake of simplicity

ip nat translation timeout 3600
ip nat translation tcp-timeout 1200
ip nat translation finrst-timeout 15
ip nat translation syn-timeout 45
! forward port 80 to 10.0.0.4:80
ip nat inside source static tcp 10.0.0.4 80 interface Dialer1 80
! enable NAT on Dialer1 interface
ip nat inside source list 1 interface Dialer1 overload
access-list 1 permit 192.168.0.0 0.0.255.255


SpeedTouch 780 DocumentationLast edited on Feb 25, 2012



SPA941 PhoneBookLast edited on Feb 25, 2012

Personal Directory

An annoying thing with that phone is that it is impossible to provision the phone directory automatically. The good thing is, you can fill the list from the web page of the phone. So then, with wireshark I looked at how this information is posted. All you need is the following script that will simulate a browser submitting the list of numbers. You might wanna check the list of input fields ID, I am not sure if they will be the same on each devices depending on firmware version.

$fields = Array("43311","43503","43439","44655","44591","44783","44719","44911","44847","45039",
"44975","44143","44079","44271","44207","44399","44335","44527","44463","37487","37423","37615",
"37551","37743","37679","37871","37807","36975","36911","37103","37039","37231","37167","37359",
"37295","38511","38447","38639","38575","38767","38703","38895","38831","37999","37935","38127",
"38063","38255","38191","38383","38319","39535","39471","39663","39599","39791","39727","39919",
"39855","39023","38959","39151","39087","39279","39215","39407","39343","40559","40495","40687",
"40623","40815","40751","40943","40879","40047","39983","40175","40111","40303","40239","40431",
"40367","33391","33327","33519","33455","33647","33583","33775","33711","32879","32815","33007",
"32943","33135","33071","33263","33199","34415");

$conn = mysql_connect("localhost","username","password");
mysql_select_db("dbname");
$query = "SELECT * FROM phonebook ORDER BY name;";
$result = mysql_query($query);

$i=0;
$list="";
$n = mysql_num_rows($result);
while ($record = mysql_fetch_assoc($result)) {
        $name = $record['name'];
        $phone = $record['phone'];
        $name = urlencode($name);
        $phone=urlencode($phone);
        $field = $fields[$i];
        $list .= "$field=n%3D$name%3Bp%3D$phone";

        $i++;
        if ($i<$n) $list .= "&";
}

system("wget --post-data '$list' http://192.168.0.107/pdir.spa -t 1");

Executing that script will fetch all entries in the mysql server and post them on the phone located at 192.168.0.107



Pages:123456789101112