Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-09-2004, 12:29 PM   #1
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, 12:46 PM   #2
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, 12:47 PM   #3
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. 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. The Freevo machine should then have it's default gateway set to the eth1 IP address of the main machine ( 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.


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 12:11 PM
shared internet connection zoffmann Linux - Networking 2 06-15-2005 04:51 PM
Cant get internet of shared XP connection... Dover1123 Linux - Networking 5 07-29-2004 07:07 PM
Problems with Shared internet using Router TiMo Linux - Networking 3 09-06-2003 07:44 AM
Shared Cable internet connection problems sgroy45 Linux - Networking 6 03-07-2002 03:50 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:45 PM.

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