• Welcome to New Hampshire Underground.
 

News:

Please log in on the special "login" page, not on any of these normal pages. Thank you, The Procrastinating Management

"Let them march all they want, as long as they pay their taxes."  --Alexander Haig

Main Menu

Need help with Linux

Started by 41mag, March 11, 2007, 09:31 PM NHFT

Previous topic - Next topic

41mag

I'm trying to get a second computer to see my internet connection.  I've tried stumbling through iptable settings for forwarding, but have not be able to get it working. 

I'm in New London (NH, not CT).

error

Quote from: 41mag on March 11, 2007, 09:31 PM NHFT
I'm trying to get a second computer to see my internet connection.  I've tried stumbling through iptable settings for forwarding, but have not be able to get it working. 

Save yourself a lot of trouble and pick up a home router designed for this purpose from your nearest, uh, well, I suppose there aren't any THAT nearby. There's a Best Buy in Concord...

If you really REALLY want help with this, get hold of me on AIM.

penguins4me

I'm by no means a networking expert, but I went from a "home router" to using a Linux-based PC with multiple network cards for my firewall/router.

Frankly, I'm not sure exactly what you're asking for, as "seeing the network" doesn't usually involve any need for "forwarding". If you're just looking to connect the Linux system to the network, here's an easy way to make sure the basics are okay: copy your network settings (IP, netmask, gateway, DNS) from your known-good machine, connect the Linux-machine to the known-good machine's cable, power-cycle any other network-related equipment to clear the old MACs out of caches, set up the Linux machine the same way (see below), and try to ping something.

Manually configure Linux-based system's network (as root user):
DNS: add DNS server IP to /etc/resolv.conf
IP: ipconfig <network adapter, usually eth0> <IP> netmask <netmask>
Set default gateway: route add default gw <gateway IP>

If you're not just trying to get the Linux-based machine on the network, but want a router-type setup, that's a bit more involved - might be fastest to take error up on his offer than wait for someone else (me, etc.) to post again.

PowerPenguin

I use IPCop over here. It's easy to set up, can run on old hardware, and has a nice web GUI that you can use to easily administer. HW compatibility is good too.

error

Quote from: powerpenguin on March 12, 2007, 01:53 AM NHFT
I use IPCop over here. It's easy to set up, can run on old hardware, and has a nice web GUI that you can use to easily administer. HW compatibility is good too.

I got the impression that the "first computer" in this scenario is actually in use as a normal desktop workstation.

error

Quote from: 41mag on March 11, 2007, 09:31 PM NHFT
I'm trying to get a second computer to see my internet connection.  I've tried stumbling through iptable settings for forwarding, but have not be able to get it working.

Basically it works like this (there is NO security here; do that yourself):

You plug your cable or DSL into the first Ethernet card (eth0) in your computer.
You plug the other computer into a switch connected to the second Ethernet card (eth1) in your computer.
Then you route between them. This is about as minimal as it gets:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

KBCraig

#6
Or you just plug your cable modem/DSL "non-modem" into a WRT54G (about fifty bucks at Wally World), plug additional machines into the router, and have fun.

Setting up the network for Mary's new business, we had to go with cable instead of DSL. Turns out it's cheaper to buy the Linksys cable modem and WRT54G separately, compared to the modem/switch/router/wireless WCG200 (which does the same thing in one box, instead of two).


error

I was going to suggest that, but with the nearest such retail outlet some 15 or 20 miles away, I thought better of it.

Dan

Quote from: penguins4me on March 12, 2007, 12:57 AM NHFT
I'm by no means a networking expert, but I went from a "home router" to using a Linux-based PC with multiple network cards for my firewall/router.

I did what you are considering, then I did one better: I flashed my own linux distro into my cablemodem/router:
http://www.dd-wrt.com/wiki/index.php/Installation

Best of all worlds:  A rather functional linux system in an embedded, fanless platform.  Full web gui AND ssh+text editor for your choice of configuration.  It's rock solid, I've set up three of them in as many years.


penguins4me

At the time, I wanted a router with more horsepower. The netgear model I was using choked when refreshing the list of Half-life servers using the in-game browser - the Linux router, a P-120 with 128MB of RAM, is total overkill but works well. Not fanless, but it's good enough.

IPCop and/or gShield are useful for routing newbies (I used them both to learn the basics).

41mag

Quote from: error on March 12, 2007, 01:59 AM NHFT
I got the impression that the "first computer" in this scenario is actually in use as a normal desktop workstation.
Yes, this is the computer I've been using for a while.  It's a Mac G4 and PPC Linux does not have a few things I'd like to see (flash support, etc), but does work ok.  The second computer (an older Dell/Intel machine) was given to me so I did not have to put any money into it.  I'm on a fairly limited budget, so I figured I'd just add a second ethernet card to the Mac and I'd be ok.  I'm also trying to learn about Linux somewhat on my own (most of the time, I can figure these things out).  Can anyone suggest a good refrence book (I'm somewhere between beginner and intermediate)?

Quote from: error on March 12, 2007, 01:59 AM NHFT
You plug your cable or DSL into the first Ethernet card (eth0) in your computer.
You plug the other computer into a switch connected to the second Ethernet card (eth1) in your computer.
Then you route between them. This is about as minimal as it gets:

Code:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
Yep, I've done that already.  On the Intel/Fedora computer I can ping the Mac and get a return, I just can not get out to the internet. 
QuoteChain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

error

We need a LOT more detail here. Why don't you try (again) getting hold of me on AIM.