LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2004, 01:29 PM   #1
4of11
LQ Newbie
 
Registered: Nov 2003
Location: Pitt
Distribution: Gentoo
Posts: 11

Rep: Reputation: 0
shared internet connection w/out router


I'm thinking of getting a cheap computer, installing Freevo and using it is a PVR. I would like to be able to connect it to the internet, but I already have my PC hooked up to the ethernet port. I live in a college dorm, and they don't allow routers, so I am wondering if there is a way to connect the PVR to my PC (via USB, maybe?) and have my PC forward the connection to the internet. I am fairly experienced with linux, but not so much with networking. I am running Gentoo on my PC, and would probably do the same on the PVR.
 
Old 08-09-2004, 01:46 PM   #2
superbondbond
Member
 
Registered: Nov 2002
Posts: 668

Rep: Reputation: 30
you could put two NICs in your PC, and then run iptables (masquerading, NAT, etc. etc.) to share the connection. You would essentially be using your PC as a router. shhh don't tell....

Using something like Jay's Firewall it would be extremely easy to configure and maintain.
 
Old 08-09-2004, 01:47 PM   #3
nhs
Member
 
Registered: Aug 2003
Location: Edinburgh, Scotland
Distribution: Gentoo
Posts: 246

Rep: Reputation: 30
Running a router type setup shouldn't be a problem provided you can get hold of another network card and a length of crossover cable. Should be quite cheap.

echo 1 >/proc/sys/net/ipv4/ip_forward will turn on the router functionality however a few firewall rules are needed first. The trick to keeping everything OK with the college network is to use IP Masquerading or SNAT (depending on whether you have a static IP address) where both essentially rewrite all packets leaving by a specific interface (eth0 probably) so that they appear to come from this machine. You will need to run the following line to set up the firewall:

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source IP address of eth0

for a static IP address. If your IP address changes then

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

should work. To save the configuration use "iptables-save >file". You will then need a line somewhere in your startup scripts "iptables-restore <file". Then install and configure your second network interface to use some IP address and netmask which is different from anything on the college network (e.g. 172.16.0.1 if all the addresses begin 10.). The Freevo machine will need an IP address similar (but not the same as) the IP address of the main machine (e.g. 172.16.0.2). The Freevo machine should then have it's default gateway set to the eth1 IP address of the main machine (172.16.0.1) and it should have the same level of Internet access as your main machine without any external indication that there is more than one machine connected.

I would suggest reading the iptables man page as this contains detailed information on how to configure iptables and there is a lot of information on the web about IP Masquerading as it is commonly used to share dial up modem internet connections.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows XP/SUSE 9.3 Shared Internet Connection Lord_Grave Linux - Wireless Networking 5 08-26-2005 01:11 PM
shared internet connection zoffmann Linux - Networking 2 06-15-2005 05:51 PM
Cant get internet of shared XP connection... Dover1123 Linux - Networking 5 07-29-2004 08:07 PM
Problems with Shared internet using Router TiMo Linux - Networking 3 09-06-2003 08:44 AM
Shared Cable internet connection problems sgroy45 Linux - Networking 6 03-07-2002 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration