ADSL2+ PCI Card - Single Port ADSL Modem - Annex A

From DcSharedWiki
Revision as of 03:18, 2 January 2012 by Pilou (talk | contribs) (add: how to enable telnet)

ADSL2+ PCI Card - Single Port ADSL Modem - Annex A

PCI Card

http://linitx.com/product/12181

Once card added, it appears like a Realtek 8139 pci card:

$ lspci
...
06:03.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
...


$ dmesg
[    1.340686] 8139too Fast Ethernet driver 0.9.28
[    1.340777]   alloc irq_desc for 16 on node -1
[    1.340783]   alloc kstat_irqs on node -1
[    1.340798] 8139too 0000:06:03.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    1.342475] eth1: RealTek RTL8139 at 0xffffc90010a2ec00, 00:05:b4:09:ee:6a, IRQ 16


Linux 2.4.31 run on the card. After configuring the new ethernet card, you can access to this system using 192.168.0.1 ip. Without upgrade ipv6 is not supported.

Configuration

On Debian you can edit /etc/udev/rules.d/70-persistent-net.rules in order to rename "ethX":

...
# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:05:b4:09:ee:6a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wan"
...


Add ip:

ip a add 192.168.0.254/24 dev wan

Set interface up:

ip link set up dev wan


Now you can access to the interface configuration using: http://192.168.0.1

ADSL2+ PCI Card - Single Port ADSL Modem - Annex A$login.jpg

If card is inserted on a PC which haven't X configured (ie an headless host)

                                   ---------------------------------------                   ------------------------------------
                                   - Headless host with:                 -                   - Host able to run web browser     -
                                   -                                     -                   -                                  -
telephone line <-- RJ-11 cable -----> ADSL2+ PCI Card wan - 192.168.0.10 -                   -                                  -
                                   -                                     -                   -                                  -
                                   - Network card eth0 - 192.168.1.254  <--- ethernet cable --> 192.168.1.25 eth0 network card -
                                   ---------------------------------------                   ------------------------------------


On the headless host:

sysctl -w net.ipv4.ip_forward=1

# NAT
iptables -t nat -A POSTROUTING -o wan -j SNAT --to-source eth0 --random -m comment --comment "LAN->WLAN"

# Forward
iptables -t filter -A FORWARD -i eth0 -o wan -j ACCEPT -m comment --comment "LAN->WLAN"
iptables -t filter -A FORWARD -i wan -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT -m comment --comment "LAN->WLAN"


On the other host:

ip a add 192.168.1.25/24 dev eth0
ip r add default via 192.168.1.25


Other host is now able to access to 192.168.0.1 (default password is `admin`)

Enable telnet access

telnet daemon can be enabled in "NAT Configuration" -> "Servers settings"

ADSL2+ PCI Card - Single Port ADSL Modem - Annex A$telnet.jpg

Now you can access to Linux embedded on the PCI card using telnet:

$ telnet 192.168.0.1
Trying 192.168.0.1...
Connected to 192.168.0.1.
Escape character is '^]'.
Danube login: root
Password: 


BusyBox v1.00 (2008.08.04-09:35+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

# uname -a
Linux localhost.localdomain 2.4.31-Danube-3.0.5g-A2PCI #8 �@ 8�� 4 17:34:46 CST 2008 mips unknown