WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: (solved) HOWTO setup netbook+GPRS USB like LAN router?  (Read 10313 times)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: how to setup my netbook+GPRS USB as a LAN router?
« Reply #15 on: September 13, 2012, 05:26:20 PM »
Building a router is a fairly complex task, and should not be attempted by one not willing to take the time to learn the basics.

Offline floppy

  • Hero Member
  • *****
  • Posts: 577
Re: how to setup my netbook+GPRS USB as a LAN router?
« Reply #16 on: September 14, 2012, 12:49:51 PM »
Building a router is a fairly complex task, and should not be attempted by one not willing to take the time to learn the basics.
I will. Im making progress with colleagues from the development area. I will post the success the next days here. Except somebody here is quicker than my colleagues.
AMD K6-IIIATZ 550MHz MB DFI K6xv3/+66
P4 HP DC7100 3GB 3GHz
Samsung NC10 boot from SD card port (via USB reader)
.. all TinyCore proofed

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: how to setup my netbook+GPRS USB as a LAN router?
« Reply #17 on: September 15, 2012, 11:55:13 AM »
If I had such a goal, I would look into existing router distros how they do things, avoiding to try to reinvent the wheel  ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline floppy

  • Hero Member
  • *****
  • Posts: 577
Re: how to setup my netbook+GPRS USB as a LAN router?
« Reply #18 on: September 21, 2012, 12:39:05 PM »
It runs. Im posting here from a PC connected to a LAN, connected to a netbook, connected to the internet via GPRS/UMTS USB. My setup is


Connection shematic
==================================================
 PC1   PC2    PCx
    \      |       /
      \    |     /                                netbook
       \   |   /                     ---------------------------
--------------------         I  NAT Gateway Device   I        ---------------------
I        HUB             I------I- eth0 : 192.168.3.5    I        I  Web provider       I
I                            I        I  ppp0    $DEF_GW        I-----I                             I
--------------------        ---------------------------        ---------------------

                           Samsung nc10 Plus                       pinternet.interkom.com
                           Huawei USB GPRS modem         nameserver  8.8.8.8
                           broadcast 192.168.3.255              nameserver  8.8.4.4
                           netmask 255.255.255.0                  www.fonic.de
                           gateway 10.64.64.64 = $DEF_GW

commands to be done on the netbook
=================================
tce-load -i iptables.tcz
tce-load -i iproute2.tcz
INT_DEV="eth0"
EXT_DEV="ppp0"
DEF_GW="`/sbin/ifconfig ppp0 | grep 'P-t-P' | awk '{print $3}' | sed -e 's/.*://'`"
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo /sbin/ifconfig eth0 192.168.3.5 broadcast 192.168.3.255 netmask 255.255.255.0
echo dont use 192.168.3.5 for the PCs IP but another like 192.168.3.1 or 2 or 7 ..
sudo /sbin/ifconfig eth0 up
sudo iptables -F
sudo iptables -X
sudo iptables -t nat -F
sudo iptables -t nat -X
sudo iptables -P INPUT   ACCEPT
sudo iptables -P OUTPUT  ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -A FORWARD -i $INT_DEV -o $EXT_DEV -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o $EXT_DEV -j MASQUERADE
sudo iptables -A FORWARD -i $EXT_DEV -o $INT_DEV -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo route del default
sudo route add default gw $DEF_GW


commands to be done on one PC
=================================
sudo ifconfig eth0 192.168.3.1 broadcast 192.168.3.255 netmask 255.255.255.0
sudo route add default gw 192.168.3.5
echo 192.168.3.5 is the default gateway for eth0 of the netbook router
echo 192.168.3.1 is the IP of the PC you are working on

Attention: the same resolv.conf must be used on PC and netbook.
resolv.conf        pinternet.interkom.com
                            nameserver  8.8.8.8
                            nameserver  8.8.4.4

Place for improvement:  the firewall caracteristics.
« Last Edit: September 22, 2012, 10:34:00 AM by floppy »
AMD K6-IIIATZ 550MHz MB DFI K6xv3/+66
P4 HP DC7100 3GB 3GHz
Samsung NC10 boot from SD card port (via USB reader)
.. all TinyCore proofed