Author Topic: router software  (Read 1437 times)

Offline jepetto

  • New Friend
  • *
  • Posts: 9
Re: router software
« Reply #15 on: April 14, 2012, 05:40:48 PM »
no,a router and a modem are two different things,they may be bundled together but they are different.

All you need to make a linux box a router is more than one network interface,you said you have two so your box can be used as a router. You will connect a modem(the one u r using to connect to your ISP) to one interface and set up a local area network on the other interface.

The aim was to reduce the power consumption of the modem (from ~12W (stand alone) to ~4W (PCIe)).
But, I realize that will be difficult to find it. I already searched and can not find a PCIe ADSL2+ modem.
So, will keep using the modem in use right now.


what is the output of this command?

ifconfig

there should be atleast 3 interfaces,one being "lo" interface,Identify an inerface that will be connecting to the modem

you will run two commands to set it up,you can make them survive reboots so they will be a one time investent for life time us  :D
This command I know. :)
It shows 3 interfaces:

eth0 (used in LAN)
...

eth1 (will be connected to the modem)
...

lo
...


Please, don't forget that I would like access the router statistics, requested sites, computers connected, etc...

Thanks

PS:
I can wait for an article. Would be a great idea...  ;)

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: router software
« Reply #16 on: April 14, 2012, 06:27:08 PM »
while on the terminal, log in as root and then run these two commands

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -I POSTROUTING -o eth1 -j MASQUERADE

Now start PCC and then set up eth0 to have the following network properties:

IP address: 10.10.10.10
netmask   :  255.255.255.0

PCC will complain about not being able to successfully create a connection, ignore the complaint and finish up.

Now connect a wire on this eth0 interface to your LAN and then set up a computer on your LAN to have the following network properties:

IP address: 10.10.10.20
netmask   : 255.255.255.0
gateway   : 10.10.10.10

This other computer on your LAN should now be able to go online,assuming eth1 is connected to the internet.

You have successfully used your computer as a router. If you can access the internet on this computer that now acts as a router,then all computers on your LAN with a gateway address that matches eth0 address will also be able to go online

You do not have to use the addresses i provided, I gave them as an example and for your convenience if you do not know the basics of network addresses.

explanation for those commands will be in the article  :D

we will discuss the statistics part after this first part is working.
« Last Edit: April 14, 2012, 06:31:19 PM by muungwana »
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline jepetto

  • New Friend
  • *
  • Posts: 9
Re: router software
« Reply #17 on: April 15, 2012, 03:04:59 PM »
This other computer on your LAN should now be able to go online,assuming eth1 is connected to the internet.

I can not connect to the internet because my ISP requires an username and password.
To access Internet I insert this username and password on my router.
My connection is: Internet -> modem -> router (with ISP username and password) -> LAN


Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: router software
« Reply #18 on: April 15, 2012, 03:17:45 PM »
This other computer on your LAN should now be able to go online,assuming eth1 is connected to the internet.

I can not connect to the internet because my ISP requires an username and password.
To access Internet I insert this username and password on my router.
My connection is: Internet -> modem -> router (with ISP username and password) -> LAN



If i understand your problem, then what you want is below,the above instructions still apply:

My connection is: Internet -> modem -> router (with ISP username and password) -> eth1 -> computer as second router -> eth0 -> LAN -> other computers on your LAN.

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: router software
« Reply #19 on: April 15, 2012, 10:42:13 PM »
I can not connect to the internet because my ISP requires an username and password.
To access Internet I insert this username and password on my router.
My connection is: Internet -> modem -> router (with ISP username and password) -> LAN

I believe there is a way using the "Set up a new network" wizard to have PCLinuxOS supply the password..  make sure you delete your old  LAN network setup in PCC and re-create the network connection with one appropriate to your connection type (Cable, etc)



while on the terminal, log in as root and then run these commands
.
.
.
explanation for those commands will be in the article  :D

we will discuss the statistics part after this first part is working.


This can also be set up using PCC...  set up the firewall using PCC for your internet facing network device, then use the Internet Connection Sharing (ICS) wizard in PCC...  It will also set up dhcp, squid, etc if you want.   ...IIRC the ICS wizard won't work unless the firewall is set up and running first.   I wrote up a how-to in the old wiki... but now its gone :'(



EDIT:

Here is a summary of ICS (PCLinuxOS as a Router) using PCC:

So I found another thread that had a link to a copy of the old wiki entry.  Here's what it said in case someone else comes along looking for the solution.  I tried this out and it worked like a charm.

SUCCESS!

Internet Connection Sharing

PCLinuxOS can be set up as a DHCP server / router using PCLinuxOS's Control Center (PCC). The following is a brief summary of how I did it; hopefully as time permits this this can be expanded to include more details and screenshots.

   1. Open PCC and delete all network interfaces to be sure that we are not using with old configurations.
  
   2. Connect one ethernet card (eth0) on your PCLOS DHCP server / router box directly to your internet modem and configure the connection; this can also be a ppp style usb connection commonly used for cellular and dsl modems. Don't move on until you have a working connection to the internet.
  
   3. Next use PCC to set up the personal firewall; at the last dialog box, make sure it is set to only protect the internet facing connection (eth0 or ppp0 in this example); other non internet facing interfaces should be unchecked in the last firwall configuration dialog so that the firewall allows them to be used for internet connection sharing (ICS). Having at least one protected and one unprotected interface will force a shorewall configuration that allows for ICS to be set up using PCC. If this is not configured correctly you will get an error from PCC's ICS wizard about netowrk interfaces not being configured properly.
  
   4. Back at PCC again, use the 'share internet connection' wizard to configure ICS.. make sure to select eth1, or your LAN facing network card to use for ICS; default settings should work just fine, but toward the end of the configuration wizard I did un-check the box for setting up a caching proxy server (squid) to keep the setup uncomplicated.
  
   5. Make sure there are not any other DHCP servers on the same local network.. either unplug your existing router if you have one, or turn off it's DHPC server from it's configuration page.
  
   6. Assuming your LAN facing connection is connected to a switch with other PC's, now go to the other PCs on the local network and reset their network connections so that they will now pick up new IP's from your PCLOS DHCP server.

Thats it.. it worked for me! ..if you set up the personal firewall to include intrusion detection, port scanning, etc you will get pop-up notifications and logging provided by the default network monitor in the task bar. ..head on over to the Shields-up website and initiate a port scan of your system and see how it fairs!



« Last Edit: April 16, 2012, 10:00:45 AM by travisN000 »

Offline T6

  • Super Villain
  • ******
  • Posts: 19077
  • xmas is comming!
Re: router software
« Reply #20 on: April 16, 2012, 06:37:25 AM »
yes, pcc can help you wth the user and password option bu sometimes th modem is not cooperative enough

some cablemodems work well but others gave me problems in the past
"If you wish to make an apple pie from scratch, you must first invent the universe."

Carl Sagan

Offline jepetto

  • New Friend
  • *
  • Posts: 9
Re: router software
« Reply #21 on: April 22, 2012, 06:28:51 AM »
Sorry for my replies are taking so long...

pclinuxos as router should replace router in use.
So, I follow the "GUI" suggestions posted by travisN000.

Using PCC wizards (and the config info related to my ISP), I connected to internet and share this connection with my lan.

In respect with firewall, I would like it store Internet/router/Lan activity for future statistics...
I will explore it, as soon as I have some time to do it...

If I find an easy way to access this kind of statistics, my first statement is correct (I posted a stupid question...)

Thanks for your help/suggestions

Online muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: router software
« Reply #22 on: April 22, 2012, 10:41:32 AM »
ok, now your linux box is acting as a router, step one complete.

now to get those statistics.

Install a package called "ntop".

Open the terminal,log in as root and then type "ntop" to start it up and you will be asked set it up.

Set the password and set the interface to listen to. You can change the interface to see which one works best for your use case but start with the interface that is facing your LAN.

Open a web browser and browse to "localhost:3000" and you should be able to see logs of traffic passing through your computer from your LAN.

Go to pcc->system->manage system services and make sure "ntop" is set to start at boot time and you should be set. All you will have to do now to view logs is to go to that address above.
« Last Edit: April 22, 2012, 11:07:48 AM by muungwana »
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Neo

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 487
  • I Spurius Furius Iustus
Re: router software
« Reply #23 on: April 23, 2012, 03:47:51 PM »
it is not that dangerous, dd-wrt and other options are basically very secure, not 100% secure but very secure

i will eventually use one of those in my d-link router, routers now are so cheap and gives us so many benefits, any attempt on making them stronger and more useful is welcome

as always use a pc as router has benefits like more control and special options but also disadvantages like power consumption, space, noise, price and availability of hardware always makes more simple to use a cheap router

I use Tomato on my Linksys router, the only regret I have is waiting until my warranty expired to flash the third party firmware.


Offline jepetto

  • New Friend
  • *
  • Posts: 9
Re: router software
« Reply #24 on: April 29, 2012, 04:29:55 PM »
I use Tomato on my Linksys router, the only regret I have is waiting until my warranty expired to flash the third party firmware.
Thank's for your contribution.
My warranty didn't expired yet...
Any way, I think my LAN is faster with pclinuxos than with my Linksys router... (I didn't measured it yet, but it seams...)



ok, now your linux box is acting as a router, step one complete.

now to get those statistics.

Install a package called "ntop".

Open the terminal,log in as root and then type "ntop" to start it up and you will be asked set it up.

Set the password and set the interface to listen to. You can change the interface to see which one works best for your use case but start with the interface that is facing your LAN.

Open a web browser and browse to "localhost:3000" and you should be able to see logs of traffic passing through your computer from your LAN.

Go to pcc->system->manage system services and make sure "ntop" is set to start at boot time and you should be set. All you will have to do now to view logs is to go to that address above.

Thanks muungwana,

Now I can see what is going on with my LAN.
I do not deeply explore ntop, but I like what I see.

I had an error
Code: [Select]
**ERROR** RRD: Disabled - unable to create base directory (err 13, /usr/local/var/ntop/rrd) when running ntop.
I follow the instructions in this http://www.tek-tips.com/viewthread.cfm?qid=1454649 and I can access ntop info in the address you stated. Perhaps the commands on that link are not necessary (I can not guarantee because didn't try access ntop info before using that commands.
I log in as root as you said. So I don't know what is the cause of that error.

Thank all of you for all your help.

I think I can add [solved] in the subject :)