help- setting up a small network (1 adsl modem-usb, 1x4port router, 4 pcs)

By mke
Aug 13, 2005
Topic Status:
Not open for further replies.
  1. Hi, i am trying to setup my small net in home but all this time i ended up with nothing.
    Basically i just got a 512 adsl with a simple modem and want to share it with the other pcs in the house. I have also an old router that has been used in the past to share my old connection (cable from ntl last year).
    Now i cant figure out how to setup everything so it works.
    basically it looks like:

    adsl modem (usb modem without any rj45 ports, just a usb)
    |
    |
    main pc (connected to uplink port on router)
    |
    |
    router
    | \ `\
    | \ ``\
    | \ ``\
    pc1 pc2 pc3


    This is it. i know its not the best setup but i cant afford at the moment any other hardware and i would really appreaciate if someone could show me how the ip allocation would be for this setup. i tried changing the gateways, using the dchp from the router, and all types of addressing. any help would be really appreaciated.
    thanks!
  2. RealBlackStuff

    RealBlackStuff Newcomer, in training Posts: 8,165

  3. zephead

    zephead TechSpot Paladin Posts: 2,483

    usually you'd hook up the modem directly to the router, but apparently that isn't an option for you. you need an internet gateway to allow multiple pcs access the same internet connection. this gateway is important because it handles network access translation (NAT) and other protocols that allow the sharing of an internet conenction. the bottom line is that you need a gateway (which i'm assuming your router is too) connected to your modem.
  4. RealBlackStuff

    RealBlackStuff Newcomer, in training Posts: 8,165

    I was too fast, I guess.
    This is a new category of Internet Gateway designed to skip the hub
    component between the router and your pc to keep both the cost of hardware
    down and to restrict you to a single pc.

    You have three options:
    1: Use the Windows PC that the modem is plugged into as your Internet
    Gateway for all other pc's (just add a second NIC).
    2: Replace the USB modem they give you with a non-USB modem that plugs into
    your hub/switch.
    3. Ask the modem supplier (Bellsouth ?) if they would provide an alternate non-USB modem or allow you to supply your own.

    Note: USB modems are only likely to work with Windows due to a lack of
    drivers for any other suitable platform (read Linux) that supports USB. If
    you are interested in the details of the USB modem from Linksys
    http://www.linksys.com/products/product.asp?prid=162&grid=20
  5. mke

    mke Newcomer, in training Topic Starter Posts: 146

    thx for replying but i cant say that i solved anything yet. i want that the main pc connected to the modem to be as a "gateway" which then connects to the router.
    The thing is that i cant allocate correclty the ip addressing to the router and the other pcs.

    currently it looks like:

    1.) Server-Gateway to usb modem(usb network - enable share internet conn)
    =================================
    IP: as per isp - public ip 83.x.x.x
    Subnet: as per isp - 255.255.255.0
    Gateway: as per isp - ?
    DNS: as per isp - 158.152.1.58


    2.) Server-Gateway (ethernet network to uplink on router)
    =======================================
    IP: 192.168.1.254
    Subnet: 255.255.255.0
    Gateway: ?
    DNS: ?


    3.) Router (uplink port to server gateway)
    ============================================
    IP: 192.168.1.100
    Subnet: 255.255.255.0
    Gateway: 192.168.1.254
    DNS:


    4.) Router further settings
    ============================================
    NAT: ?
    DMZ: ? (Only one host possible?)
    DCHP: disabled;


    5.) PC1 settings
    =============================
    IP: 192.168.1.101
    Subnet: 255.255.255.0
    Gateway: 192.168.1.100
    DNS: ?


    6.) PC2 settings
    =============================
    IP:
    Subent:
    Gateway:
    DNS:

    -------edited--------------------
    also wanted to note that on the router i can configure settings like:
    wan ip:
    gateway:
    lan ip:
    .........
    -----------------------------------

    this hasnt been working and dont know really how to make that work. If i could i would buy a adsl morem/router with 4 ports but i recieved a bill today for my old dialup for 70 pounds and that strucks me back a month to be able to afford any other hardware. I would be really gratefull if anyone could post a settting for this configuration.

    Again many thanks for your time and help.
  6. tdeg

    tdeg Newcomer, in training Posts: 348

    Crappy that they gave you a USB modem.

    Hook the modem up to your main PC and get that working first. After it is, run the ICS on the main computer and set that all up.

    Using one of your other PCs, log onto the router and turn off the DCHP server on it. After that change its the router's IP address to one that is in the same subnet that ICS provides. I think it will be 192.168.0.x. Maybe give it 192.168.0.151. The router will reboot at that point. Hook your gateway PC to a <b>normal</b> port on the router's 4 port switch. Don't use the uplink. After that hook the rest of your PCs up to the remaining 3 ports and reboot them.

    Your router is basically going to just be acting like a switch and the router portion of it is going to be not used.

    The three non-gateway PCs should have an IP address of 192.168.0.x and their gateway should be the same as the IP address on the lan side of the gateway.
  7. mke

    mke Newcomer, in training Topic Starter Posts: 146

    thank you!!! it works fine now. all the computers on the network have access on the internet and with the help of analogx port mapper i can forward ports to specific computers on the network.
    The only problem i find is that while i attempt to browse the network (neighborhood) it takes a long time to load it. From my mandrake system(onboard nic) it takes with samba about 5 minutes to display contents and with my xp system(onboard broadcom hp) it takes again over 4-5 minutes. This happens every time i want to view a shared folder or browse the network. Apparently when i mount the folders to the local systems they load pretty alright, but thats something i rather not have to do every time cause i switch them quite often. All/most of my shared resources are on the gateway which runs on a windows 2000 with a realtek nic. I dont think its the specs of the gateway as its decent i think for this purporse (2.4amd, 512ddr, 2x250sata, 1x120ata).
    Is there something i am missing? can i drastically improve the network performance and have a browsing in less than 15 seconds?
    again thx for all the help and hope that someone knows a solution to this.
  8. RealBlackStuff

    RealBlackStuff Newcomer, in training Posts: 8,165

    One solution would be to buy a network drive, which is hooked up via ethernet or USB2.0 to your router. This is available 24/7 for every PC. Make that the shared disk for all.
    http://www.freecom.com/ecNewsitem.asp?ID=3874
    available in 80-400GB versions
  9. mke

    mke Newcomer, in training Topic Starter Posts: 146

    i was thinking of assembling one myself in the past with possibility to expand it from 2x250 to 4 drives. but i came to the conclusion that till i get a decent payed job i will not invest into any other luxury hardware. the point is though that the windows system tempts to be slow in repsonse to viewing the network or upgrading its contents. I have noticed that many times there is a really old folder within the share, although that i had deleted it in the past month or so.
    I know that probably active directory could also do this job and organize everything, but even then, it would relly on the windows capabilties of searching/exploring and updating the networks contents.
    i know that there must be a tweak for this, or at least i think there is.
  10. jobeard

    jobeard TS Ambassador Posts: 13,026   +221

    sounds like the default route is wrong, timing out and the request is then rerouted.

    use netstat -r to see the routing table.
    with only one NIC in the system, Linux is neat in the routing - - needing ONLY
    two routes:
    127.0.0.0 * mask 255.0.0.0 U lo
    default 192.168.0.1 mask 0.0.0.0 UG eth0

    this says, unless it's the localhost(127.*) everything goes out the eth0
    adaptor destined for the router at 192.168.0.1
  11. mke

    mke Newcomer, in training Topic Starter Posts: 146

    hello, am back

    basically everything worked fine but had to switch to let the linux system be the gateway but that hasnt been working again.
    I have the same old usb speedtouch 330 modem, and a nic card connected to the gateway. the internet works fine for the gateway but i cant seem to make the other pcs access the internet. i tried using internet connection sharing, dchp with linux but the others still cant connect to the net.
    Could someone advise me how i can share the connection and most importantly forward ports to these systems? I am using mandrake 10.1 and setting the modem up with it was already a nightmare as drake was not configuring correctly the modem. nore was the driver and modem_run working. anyways, works now but i cant route the traffic.
    this is how it looks
    usb modem
    |
    gateway mandrake
    nic (ip 192.168.0.1)
    |
    router/switch (192.168.0.151)
    | | |
    pc1 pc2 pc3

    pc1 ip = 192.168.0.2 gateway 192.168.0.1
    pc2 ip = 192.168.0.3 gateway 192.168.0.1
    ....


    Thanks again in advance.



    --------------- edited ------------------------

    i think am getting good at it ..... it seems it partially works now. I have internet on all computers but i am missing the forwarding part. I cant seem to port forward 3 ports to the 2 clients. can someone please outline what i am missing. thanks again. :)
  12. jobeard

    jobeard TS Ambassador Posts: 13,026   +221

    you need a default route from Linux to the ISP gateway address
    run ifconfig -a to get that address and add the route to the NIC
    connected to the modem. it's ether eth0 or eth1
    the NIC with the address 192.168.01 is the down-stream; you need the
    other one.
  13. mke

    mke Newcomer, in training Topic Starter Posts: 146

    ok, now i am in a pickle. My gateway has my adsl modem on ppp0 interface and my local network on eth0 192.168.0.1. I want to allow any incomming local connections from (192.168.0.2 - 192.168.0.254)on port 555, to eth0 192.168.0.1 on same port.
    Also any internet traffic destined to my ppp0 ip and 555 port to be allowed.
    i use iptables and shorewall, and cant seem to configure it correct.

    iptables -A FORWARD -s 0/0 -i eth0 -d 192.168.0.1 -o eth0 -p TCP --sport 555 --dport 555 -j ACCEPT

    iptables -A FORWARD -s 0/0 -i ppp0 -d 83.12.x.x -o eth0 -p TCP --sport 555 --dport 555 -j ACCEPT

    but it didnt work. i know i am doing something wrong, but this is my second day on iptables and its a bit confussing. Please any help really appreciated.
    (also added in shorewall rules config file to allow this but ...)
    thanks
     
  14. jobeard

    jobeard TS Ambassador Posts: 13,026   +221

    likely because these are firewall rules and you (apparently) still lack the proper routing.

    If your ISP has a website at http://$isp/ then all your systems must be able
    to access it. Solve that first, then address the port fowarding issue.
  15. mke

    mke Newcomer, in training Topic Starter Posts: 146

    thx for replying to my post. i have access to internet from any computer in my network. i even have forwared two ports for a client on my network and works fine. i just dont let me allow connection to the specific port 555 on my gateway either from ppp0 or eth0. any ideas?
  16. jobeard

    jobeard TS Ambassador Posts: 13,026   +221

    normally, we port foward from the lan side of the router only and ignore the
    wan side.

    iptables -A FORWARD -s 0/0 -o eth0 -p TCP --sport 555 --dport 555 -j ACCEPT
    iptables -A FORWARD -s 0/0 -o eth0 -p UDP --sport 555 --dport 555 -j ACCEPT

    the outbound replies will take care of themselves. You should only need
    the outbound rule if you've set a default to DENY ALL.
  17. mke

    mke Newcomer, in training Topic Starter Posts: 146

    thx! it works now, i cant understand why i dint figure this out earlier as i forwarded the clients port. Myabe its my patience lately with all this. anyways thx again.

    byez
  18. jobeard

    jobeard TS Ambassador Posts: 13,026   +221

    good news. thanks for the feedback ;)
  19. mke

    mke Newcomer, in training Topic Starter Posts: 146

    hahaha, am back :) i bet noone would believe that i would return that fast :) anyways, since i added the two above iptable rules it seems i cant access the internet from my client pcs besides the two ports i had forwared before 2221 and 2222 and the two last ones 555 tcp and udp. When i restart my linux gateway i have to re-issue the two iptable commands again in order to forward 555. i think i can resolve this by simple writing a script to do that every time, but the pickle stands with the problem of using the internet from the clients which i cant when i forward this 555 port. why does this happen? i mean it works fine without the 555 forward? isn't that weird? anyways i hope someone can help me out again on this as this seems beyond my logic. anyways gota sleep for 3 hours as have to work later. thx again in advance for the help.
  20. mke

    mke Newcomer, in training Topic Starter Posts: 146

    hello again, seems i forgot the rule in shorewall :) not it works clean and nice.
    anyways. byezz
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.