Welcome Guest ( Log In | Register )

9 Pages « < 2 3 4 5 6 > » Bottom

Outline · [ Standard ] · Linear+

 DIY Router, Turning ur old pc into gaming router

views
     
strace
post Nov 3 2006, 12:07 PM

Ayy
*****
Senior Member
700 posts

Joined: Aug 2005
QUOTE(mokona_modoki @ Nov 2 2006, 11:27 PM)
First, let's redraw the diagram:
CODE

Clients -> router -> WAN1 (other traffic)
               |
               |
              WAN2(squid traffic only, eg: http)

To simplified, what you want is to route based on tcp port number. I'm not sure what OS you're using but it can be done as follow (in Linux iptables lingo):

1 - use NAT to redirect tcp destination port(dport) 80 to 3128(squid port). You'll also need MASQ/DNAT here for return packet...
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

2 - use packet mangle, set all traffic with tcp dport 80 to some MARK value(let say 2).
iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 80  -j MARK --set-mark 2

3 - use iproute2 to route all traffic marked with 2 to pass through WAN2
echo 202 www.out >> /etc/iproute2/rt_tables
ip rule add fwmark 2 table www.out
ip route add default via WAN2_IP_ADDR dev wan2 table www.out
ip route flush cache

Well, quite interesting setup you have there.. I'm not sure if my instruction work or not(as i never test that) but i think it will. You may need to change/play around it to test. Feedbacks are welcomed. After all, i'm still n00bish in this kind of things smile.gif

EDITED:-- after some re-read i think my packet mangling section is wrong... We should mark packet output from squid not incoming. So, the question is how to mark packet outputted from squid ?...

EDITED:-- Some answers:
http://lists.netfilter.org/pipermail/netfi...ril/060108.html
http://www.squid-cache.org/mail-archive/sq...00505/0698.html
*
Wow, clarkconnect doesn't have development tools installed by default. Besides this software will expire within a year, I dont want to recompile the kernel again annually.

Since squid packets can't be marked without ROUTE mangle, how about I put it this way:
CODE

Clients -> router -> WAN1 (squid traffics)
               |
               |
              WAN2(other traffics)

Yes this is more simple, divert all connections excluding squid/other ports to WAN2.
Sorry, I'm really bad with iptables tongue.gif
angeldothack
post Nov 3 2006, 12:28 PM

Ore.?
******
Senior Member
1,072 posts

Joined: Jan 2003
From: 8 5 0 0 0


from what i read, it's not advisable to install development package in any dedicated router. usually after i compile something, i removed it back. i might be wrong though unsure.gif
strace
post Nov 3 2006, 12:33 PM

Ayy
*****
Senior Member
700 posts

Joined: Aug 2005
yeah, security wise yes but not that much. You wouldn't know some people who managed to break in might compile sniffers or custom "files" in your router.
TSsyyang85
post Nov 3 2006, 06:14 PM

Enthusiast
*****
Senior Member
982 posts

Joined: May 2005
QUOTE(sunmaster @ Nov 3 2006, 10:32 AM)
syyang85: will try it when i got a hold on my old pc.. The problem is the old pc is in my home town!!  sad.gif  I'll go back only by this month end.. Maybe this weekend will try on vmware 1st.. Anyway thank for the info.. icon_rolleyes.gif
BTW, is it possible to wifi with this DIY router? Maybe something like this,

CODE
[Internet] -> [DIY router PC] -> [wifi adapter] -> [client pc]


or something like that??  biggrin.gif
(or maybe the 2nd NIC in the DIY router is the wifi adapter,which means DIY router + wifi adapter is in 1 box)

I'm noob in this networking stuff?? But I'm very interested in networking my home...  biggrin.gif
*
No, that wouldn't be possible, you'll be needing wireless router or WAP(wireless access point), It works just like a normal switch except, its wireless.
mokona_modoki
post Nov 3 2006, 07:04 PM

Getting Started
**
Junior Member
267 posts

Joined: Jul 2006


QUOTE(strace @ Nov 3 2006, 12:07 PM)
Since squid packets can't be marked without ROUTE mangle, how about I put it this way:
CODE

Clients -> router -> WAN1 (squid traffics)
               |
               |
              WAN2(other traffics)

Yes this is more simple, divert all connections excluding squid/other ports to WAN2.
Sorry, I'm really bad with iptables tongue.gif
*
In former problem:
No, there is no need for squid patching. My mangle rule is wrong, the correct one is already answered in the mailing list. That is change from:
iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 80 -j MARK --set-mark 2
to
iptables -A OUTPUT -t mangle -p tcp --dport 80 -j MARK --set-mark 2
For a while i was confuse with chain OUTPUT because i guess it evaluated after routing already done, but the truth is not. See http://l7-filter.sourceforge.net/PacketFlow.png to see how routing is decided.
After that, just follow for the rest.

Current setup:
- I would prefer the former rather than later as it's cleaner approach. If you decide to use this setup, you'll need to mark every packet except tcp dport 80. This would also increase unnecessary processing overhead. But the concept is still the same:
- route only happen at IP layer, so it don't know about TCP port number. So it needs help from iptables.
- iptables know about TCP layer, so it can check the source/dest port for each packet. To work with route, iptables will mark the necessary packet with special "tag".
- route see packet with special "tag", send them to correct interface (eg: wan2).

Notes:
- iptables know nothing about application layer. So if you want up to application control(eg: http only, not port 80 tcp), then you'll need another piece of software. (Eg: snort-inline). But remember, the higher TCP layer you use, the higher processing overhead would occur. So, for this example i'll just use tcp port 80 which should be adequate.

QUOTE(sunmaster @ Nov 3 2006, 10:32 AM)
BTW, is it possible to wifi with this DIY router? Maybe something like this,

CODE
[Internet] -> [DIY router PC] -> [wifi adapter] -> [client pc]


or something like that??  biggrin.gif
(or maybe the 2nd NIC in the DIY router is the wifi adapter,which means DIY router + wifi adapter is in 1 box)

I'm noob in this networking stuff?? But I'm very interested in networking my home...  biggrin.gif
*
If your card support hostap, it can be converted to Access Point.
http://hostap.epitest.fi/

QUOTE(xenothrix @ Nov 3 2006, 10:32 AM)
actually i m interested to set up a kind of failover dual-wan setup as traffics r mainly HTTP, POP3/SMTP, IM n once in while VPN/RDC/VNC to desktops at customer sites. the main concern is, HTTP as our job deals with web-based developments. double the speed is not quite an issue as current 1mbps HTTP connection will b more than enough to cater the clients. Only thing is the current router modem seems to die off when number of clients increase.

thanks for clarifying the issue!
will try to set up a terminal when i get the access to a free desktop unit.
*
I see, so what you want is High-Availability(HA) not High Performance(HP). If i recall correctly, you'll need a daemon to monitor line status. If fail, then failover.. maybe this site could help you:
http://www.linux-ha.org/
wilson88
post Nov 3 2006, 07:55 PM

Dupe Acc
******
Senior Member
1,807 posts

Joined: Jul 2005
From: World Wide Web
err .. if I need to put wireless ? I just connect my wireless access point to the switch ?

If I am using wireless router , do I need to set anything on the wireless router ?
sunmaster
post Nov 4 2006, 01:34 AM

New Member
*
Junior Member
46 posts

Joined: Jan 2003
From: keh-el


QUOTE
If your card support hostap, it can be converted to Access Point.
http://hostap.epitest.fi/


erm.. I do not really understand here.. blush.gif Let me try to get you..
Is is what you are trying to say is,

1) 1st NIC is connected to internet
2) 2nd NIC is acctually a somesort of PCI wireless access card(does this exist??) rclxub.gif

OR can be drawn like this,
CODE
[Internet] -> [DIY router PC] -> [WAP] -> [client pc]

both NIC is normal NIC cards...



you quoted, If your card support hostap, are you refering to NIC card?

sorry for the noobness.. tongue.gif It just that I got a picture in my mind but not sure on how to do it in real life.. unsure.gif

TSsyyang85
post Nov 4 2006, 04:10 AM

Enthusiast
*****
Senior Member
982 posts

Joined: May 2005
QUOTE(sunmaster @ Nov 4 2006, 01:34 AM)
erm.. I do not really understand here..  blush.gif Let me try to get you..
Is is what you are trying to say is,

1) 1st NIC is connected to internet
2) 2nd NIC is acctually a somesort of PCI wireless access card(does this exist??) rclxub.gif

OR can be drawn like this,
CODE
[Internet] -> [DIY router PC] -> [WAP] -> [client pc]

both NIC is normal NIC cards...

you quoted, If your card support hostap, are you refering to NIC card?

sorry for the noobness.. tongue.gif It just that I got a picture in my mind but not sure on how to do it in real life.. unsure.gif
*
he was mentioning abt whether if the pci wireless card support hostap
sunmaster
post Nov 4 2006, 12:25 PM

New Member
*
Junior Member
46 posts

Joined: Jan 2003
From: keh-el


rclxms.gif

thanks.. that means this DIY router can be made into DIY wireless router also.. icon_idea.gif

blindbox
post Nov 4 2006, 04:48 PM

Meh
******
Senior Member
1,705 posts

Joined: Nov 2004


QUOTE(wilson88 @ Oct 27 2006, 10:06 AM)
al these for linux only ? are these programs available for windows ?? I m linux n00b rclxub.gif I having hard time to linux , I don't even know how to install stuff , those command are too rclxub.gif
*
Linux is free, safe, fast and no limits.

Btw, Windows put a limit on how many can connect to your pc, though hackers got a way around long long time ago.


I got no computer to do that, my Pentium 233 mhz pc died 3 to 5 years ago.
strace
post Nov 4 2006, 07:16 PM

Ayy
*****
Senior Member
700 posts

Joined: Aug 2005
QUOTE(mokona_modoki @ Nov 3 2006, 07:04 PM)
In former problem:
No, there is no need for squid patching. My mangle rule is wrong, the correct one is already answered in the mailing list.....blah blah
*
Thanks, I'll try that on monday biggrin.gif
Christopher_LKL
post Nov 5 2006, 01:17 AM

Kairi Kawaii ^^
******
Senior Member
1,399 posts

Joined: Jan 2003
From: Destiny Island


hey guys, can ClarkConnect added with any Bit TOrrent/Download module? i mean any idea? if not any other recommend software that can do such thing? but i also need NAS+Router+download station+webserver tongue.gif
xenothrix
post Nov 5 2006, 05:01 PM

RB26DETT
******
Senior Member
1,394 posts

Joined: Jan 2003
From: 68000


QUOTE(mokona_modoki @ Nov 3 2006, 07:04 PM)
I see, so what you want is High-Availability(HA) not High Performance(HP). If i recall correctly, you'll need a daemon to monitor line status. If fail, then failover.. maybe this site could help you:
http://www.linux-ha.org/
hi, thanks bro.
but i m very very new to linux, especially this type of router configurations. the most i did on linux was to boot off the ubuntu live cd.
any recommended config, like ipcop to put up a working router first? (put aside the multi wan thing n as long as i can control audio streaming as it created havoc in the office network)
any more links to read? notworthy.gif notworthy.gif
6650
post Nov 5 2006, 05:55 PM

Getting Started
**
Junior Member
224 posts

Joined: Aug 2006
From: Klang
need what kinda of modem? Nomal old school dial up modem can or not?
wilson88
post Nov 5 2006, 07:34 PM

Dupe Acc
******
Senior Member
1,807 posts

Joined: Jul 2005
From: World Wide Web
QUOTE(6650 @ Nov 5 2006, 05:55 PM)
need what kinda of modem? Nomal old school dial up modem can or not?
*
u have to use ADSL modem icon_idea.gif
TSsyyang85
post Nov 5 2006, 11:57 PM

Enthusiast
*****
Senior Member
982 posts

Joined: May 2005
no no no..u wilson88 are wrong.
ipcop acts like a router it it givs NAT service to yout network computers. You can use 56k or ISDN modem to connect to internet too.but there's no point sharing that 56k dial up speed among ur computers rite? laugh.gif

QUOTE(xenothrix @ Nov 5 2006, 05:01 PM)
hi, thanks bro.
but i m very very new to linux, especially this type of router configurations. the most i did on linux was to boot off the ubuntu live cd.
any recommended config, like ipcop to put up a working router first? (put aside the multi wan thing n as long as i can control audio streaming as it created havoc in the office network)
any more links to read?  notworthy.gif  notworthy.gif
*
How abt reading my tutorial in my link that i've posted in my 1st post? It's abt from installing the ipcop up until setting up streamyx account. With screenshots of course for easier understanding.
http://forum.lowyat.net/index.php?showtopi...dpost&p=8910498
For audio streaming control, you'll need to install extra Advance Qos. You can apply rules for audio streamings. like say..reserve or limit 20% of the bandwidth for it

This post has been edited by syyang85: Nov 6 2006, 12:04 AM
Christopher_LKL
post Nov 6 2006, 10:03 PM

Kairi Kawaii ^^
******
Senior Member
1,399 posts

Joined: Jan 2003
From: Destiny Island


err .... hi, still how to get BT/FTP/Direct download working with ClarkConnect or any other ... any idea how? thanks!
wilson88
post Nov 7 2006, 10:30 AM

Dupe Acc
******
Senior Member
1,807 posts

Joined: Jul 2005
From: World Wide Web
QUOTE(syyang85 @ Nov 5 2006, 11:57 PM)
no no no..u wilson88 are wrong.
ipcop acts like a router it it givs NAT service to yout network computers. You can use 56k or ISDN modem to connect to internet too.but there's no point sharing that 56k dial up speed among ur computers rite? laugh.gif
How abt reading my tutorial in my link that i've posted in my 1st post? It's abt from installing the ipcop up until setting up streamyx account. With screenshots of course for easier understanding.
http://forum.lowyat.net/index.php?showtopi...dpost&p=8910498
For audio streaming control, you'll need to install extra Advance Qos. You can apply rules for audio streamings. like say..reserve or limit 20% of the bandwidth for it
*
blush.gif I kena pwned !! tongue.gif

hahahaha sorry , my mindset was set to ADSL rclxub.gif I didn't think of 56k blush.gif I kick 56k out of my mind ade blush.gif
xenothrix
post Nov 7 2006, 03:46 PM

RB26DETT
******
Senior Member
1,394 posts

Joined: Jan 2003
From: 68000


QUOTE(syyang85 @ Nov 5 2006, 11:57 PM)
no no no..u wilson88 are wrong.
ipcop acts like a router it it givs NAT service to yout network computers. You can use 56k or ISDN modem to connect to internet too.but there's no point sharing that 56k dial up speed among ur computers rite? laugh.gif
How abt reading my tutorial in my link that i've posted in my 1st post? It's abt from installing the ipcop up until setting up streamyx account. With screenshots of course for easier understanding.
http://forum.lowyat.net/index.php?showtopi...dpost&p=8910498
For audio streaming control, you'll need to install extra Advance Qos. You can apply rules for audio streamings. like say..reserve or limit 20% of the bandwidth for it
*
did read ur tutorial. hv to read more as this stuff is quite new to me..haha...
hv to figure out when i get my hands on it.
TSsyyang85
post Nov 8 2006, 01:08 PM

Enthusiast
*****
Senior Member
982 posts

Joined: May 2005
Too bad i dun hav two lines. If no,t i definitely gonna try that out. Double the speed!

9 Pages « < 2 3 4 5 6 > » Top
 

Change to:
| Lo-Fi Version
0.0260sec    0.97    6 queries    GZIP Disabled
Time is now: 18th December 2025 - 10:41 PM