LinuxQuestions.org
Visit Jeremy's Blog.
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 09-30-2005, 10:21 PM   #1
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
Two computers need to connect to the net through a third one.


Here is the deal, again. I always start out that way. LOL Anyway, I just got another old Proliant 6000 rig with a ethernet card. I have onther compuer that sits in the closet and runs folding. I plan to run folding on the Proliant too. All that comes through my main rig. Some thing like this:

Code:
putput  >>  |
                   |
                   | >>>>>>>> smoker.net >>>  dial-up modem  >>> internet
                   |
                   |
pokey.net >
Naturally putput and pokey.net are connected by ethernet cable. IP address:

putput 192.167.0.2

pokey.net 192.168.0.5

Smoker.net has two networks cards so it has two numbers, I guess that is right.

eth0 192.168.0.1 for pokey connection

eth1 192.167.0.1 for putput connection

I used to could get pokey.net to connect to the net by running this little script:

Code:
#!/bin/bash
 IPTABLES='/sbin/iptables'
# Set interface values
 EXTIF='ppp0'
 INTIF1='eth1'
 INTIF2='eth2'
 
# enable ip forwarding in the kernel
 /bin/echo 1 > /proc/sys/net/ipv4/ip_forward
# flush rules and delete chains
 $IPTABLES -F
 $IPTABLES -X
# enable masquerading to allow LAN internet access
 $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
# forward LAN traffic from $INTIF1 to Internet interface $EXTIF
 $IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state
NEW,ESTABLISHED -j ACCEPT
# forward LAN traffic from $INTIF2 to Internet interface $EXTIF
 $IPTABLES -A FORWARD -i $INTIF2 -o $EXTIF -m state --state
#NEW,ESTABLISHED -j ACCEPT
 #echo -e "       - Allowing access to the SSH server"
 $IPTABLES -A INPUT --protocol ssh --dport 22 -j ACCEPT
 #echo -e "       - Allowing access to the HTTP server"
 $IPTABLES -A INPUT --protocol tcp --dport 80 -j ACCEPT
# block out all other Internet access on $EXTIF
 $IPTABLES -A INPUT -i $EXTIF -m state --state NEW,INVALID -j DROP
 $IPTABLES -A FORWARD -i $EXTIF -m state --state NEW,INVALID -j DROP
Since I hooked the second card, it doesn't work anymore either.

This may be info overload here but I'm going to post all the info I can think of. First is smoker.net, my main rig that I connect to the net with through a modem:

Code:
root@smoker / # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:01:53:81:00:E7
          inet addr:192.168.0.1  Bcast:192.168.0.25  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:643 errors:0 dropped:0 overruns:0 frame:0
          TX packets:980 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:102744 (100.3 Kb)  TX bytes:88724 (86.6 Kb)
          Interrupt:10 Base address:0xc000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3233 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3233 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:229234 (223.8 Kb)  TX bytes:229234 (223.8 Kb)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:205.208.159.72  P-t-P:205.208.156.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:405 errors:2 dropped:0 overruns:0 frame:0
          TX packets:466 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:76011 (74.2 Kb)  TX bytes:60593 (59.1 Kb)

root@smoker / # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
JacksonMS.TNT.0 *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         JacksonMS.TNT.0 0.0.0.0         UG    0      0        0 ppp0
root@smoker / #
Same thing for pokey.net:

Code:
pokey ~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:01:53:80:DC:35
          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2078 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1762 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:208802 (203.9 Kb)  TX bytes:329530 (321.8 Kb)
          Interrupt:11 Base address:0xde00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

pokey ~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         smoker.net      0.0.0.0         UG    0      0        0 eth0
pokey ~ #
This is for putput:

Code:
putput root # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:08:C7:28:12:00
          inet addr:192.167.0.2  Bcast:192.167.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3376 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2217 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:307012 (299.8 Kb)  TX bytes:334756 (326.9 Kb)
          Interrupt:10 Base address:0x4000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:80 errors:0 dropped:0 overruns:0 frame:0
          TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6032 (5.8 Kb)  TX bytes:6032 (5.8 Kb)

putput root # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.167.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
putput root #
If you have a better way to set this up and want to help me a bit, let me know. I just want something that works and works well. I have iptables installed as well and use a 2.6 kernel if that matters.

Any, I do mean any, help would be appreciated. This is for folding by the way.

Thanks

 
Old 09-30-2005, 10:39 PM   #2
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058

Original Poster
Blog Entries: 2

Rep: Reputation: 79
Oh, I forgot to mention that putput can ping smoker and pokey.net can ping smoker.net as well. I can also ssh into both pokey.net and putput from smoker.net. The cards and all work, I just need it to connect to the net.

Thanks

 
Old 10-01-2005, 12:38 AM   #3
shuuhen
Member
 
Registered: Jun 2004
Distribution: Mac OS X 10.6.6, Gentoo Linux, FreeBSD 6.0
Posts: 127

Rep: Reputation: 20
The first problem I see is the script uses eth1 and eth2 for the internal networks, but I don't see either in the ifconfig output from smoker. It looks like you just need to modify the script to use eth0 and whatever the second NIC is registered as on the machine.
 
Old 10-01-2005, 01:04 AM   #4
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058

Original Poster
Blog Entries: 2

Rep: Reputation: 79
OK. I added this to the script and made it look like this:

Code:
# Set interface values
 EXTIF='ppp0'
 INTIF0='eth0'
 INTIF1='eth1'
 INTIF2='eth2'
 INTIF3='eth3'
Now I can connect to the net with pokey.net but putput does not. This is what I get from putput when I try to fetch foldingathome:

Code:
putput root # emerge -f foldingathome
Calculating dependencies ...done!
>>> emerge (1 of 1) sci-biology/foldingathome-5.0.2-r3 to /
>>> Downloading http://www.stanford.edu/group/pandeg...H502-Linux.exe
--18:30:59--  http://www.stanford.edu/group/pandeg...H502-Linux.exe
           => `/usr/portage/distfiles/FAH502-Linux.exe'
Resolving www.stanford.edu... failed: Temporary failure in name resolution.
!!! Couldn't download FAH502-Linux.exe. Aborting.

!!! Fetch for /usr/portage/sci-biology/foldingathome/foldingathome-5.0.2-r3.ebuild failed, continuing...



!!! Some fetch errors were encountered.  Please see above for details.


putput root #
I did copy resolv.conf over from smoker to putput just like I did for pokey.net. It seems that I can talk to it but it does not know how to get from the ethernet card to my modem or something. Is it a route command that I need or something to do with the tables thing?

In case you can't tell, I'm not real good at networking, yet. I need to go get a book and read up on it but they seem to sail over my head because I don't do a lot of networking. I'm not even going to try wireless yet.

I did notice a difference between the return of route on putput and pokey though. This is pokey:

Code:
pokey ~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         smoker.net      0.0.0.0         UG    0      0        0 eth0
pokey ~ #
This is putput:

Code:
putput root # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.167.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
putput root #
One is missing on putput. How do I add that? I have tried different route commands but all I get is a error. That man page looks like greek too. O_O

Thanks for the help. I need it. Oh, my ISP blocks all pings. I am limited to using emerge to try to fetch foldingathome to test it.



I hope this post looks OK. I did it all by hand in a quick reply.
 
Old 10-01-2005, 01:16 AM   #5
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058

Original Poster
Blog Entries: 2

Rep: Reputation: 79
Wooooooo Hooooooooooo!!!!!!!! I got it working. For those searching for a fix, here is what I typed in:

Code:
putput root # route add default gw 192.167.0.1
I think it tells it to look to 192.167.0.1 for the net. I typed that in on putput, the machine trying to get through smoker to the net.

Thanks for the help. You got me started for sure. I was reading the man page when the bulb went off. I sort of think I understand it anyway. I plan to sync, then install folding and let her rip. She's slow but it works anyway. Might take a couple weeks for it to finish a unit thing.

Thanks again.

 
  


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
Other computers cant connect to me? empiiricus Linux - Networking 1 05-17-2004 09:31 AM
How to connect 2 SuSE computers? 4levels Linux - Newbie 3 05-12-2004 02:29 AM
2 computers, ssh and the net cyborg_jt Linux - Networking 7 02-03-2004 02:15 AM
My computers cannot connect to each other using samba ! Help! ZhiYi Linux - Networking 7 02-12-2003 07:08 AM
Trying to connect to other computers on the network hextex Linux - Networking 1 05-04-2001 08:13 PM

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

All times are GMT -5. The time now is 04:47 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
Open Source Consulting | Domain Registration