LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to share internet in dual fedora box (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-share-internet-in-dual-fedora-box-283802/)

lumba 01-29-2005 03:24 PM

How to share internet in dual fedora box
 
I have a lan made of two Fedora Core that has host names "jinan" and "Zebra". There is one ethernet card eth0 installed in "jinan" and two cards, eth0 and eth1 in "Zebra". I am able to ping all host names and ips from any of them. Zebra has Xdsl connection to the internet via eth0 and connected to "jinan" via eth1. Zebra was configured to enable packet forwarding so i can access the internet from jinan. I changed "net.ipv4.ip_forward=1"in sysctl.conf. I also configured Zebra as nfs server to share a directory called linuxnetwork and made sure nfs is installed and running. I created a directory in jinan called Zebra_share to map to the shared directory linuxnetwork.
The problem is that i was not able to mount the directory Zebra_share. From Jinan i entered the command: mount Zebra:/home/user.../ linuxnetwork ./Zebra_share.
I get the message "mount to NFS server 'Zebra' failed: server is down". I don't know what more i need to configure for Zebra to be available as an NFS. Even after i get the failed nfs message, i am still able to ping and tracerout.
I was not able to access the internet from jinan via Zebra and i was never able to telnet any host from the other one.
You guys are very helpful and i appreciate that. I received help before from comprookie and i can use some more in this one.

homey 01-29-2005 03:58 PM

Try these commands from both Fedora boxes:
chkconfig --level 5 nfs on
service nfs restart

lumba 01-29-2005 05:16 PM

it confirmed a list of oks including "starting nfs services and nfs mounted", but i still get the same error
"mount to NFS server 'Zebra' failed: server is down

proxyghost 01-29-2005 07:09 PM

What type of network cable are you using? Standard or Crossover cable.
If you are using standard pick up a Crossover cable and try that. A standard network cable will cause problems when connected between two computers directly.

foo_bar_foo 01-29-2005 11:24 PM

this is kind of two different issues (i hope i'm not confused about the names )
on Zebra run this script as root after you chmod 755 it
Code:

#!/bin/bash

echo "setting up IPmasquerading......"

IPTABLES='/sbin/iptables'

#All The lines below are NAT routing

# flush any old rules
$IPTABLES -F -t nat

# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o eth0 -j MASQUERADE

# enable IP forwarding (of incoming packets)
echo 1 > /proc/sys/net/ipv4/ip_forward

then you need to set jinan to see Zebra as "default gateway"

you netmask for your LAN might do this?
no doubt in your network setup there is a way to configure "Gateway"
i just don't know how to do it
but i do know how to do it i think with the "route" command
so try this on jinan - at least it's a hint or clue and if it works can go in a bootup script
route add Zebra-gw eth0
route add default gw Zebra-gw

you can look at your machines routing table with the "route" command by itself
see "man route"

--------
lets see for the NFS it's been a long time so info might be old !
if you have portmapper running
rpcinfo -p Zebra
should return a upd port listening called nfs
on Zebra rpc.mountd and rpc.nfsd should be running as well as
two kernel modules nfs and nfsd loaded
as well as having set up /etc/exports

lumba 01-30-2005 05:06 AM

foo_bar_foo has good info, but I just don't know how to make these changes. in FC3 i can add routes in File "/etc/sysconfig/network-scripts/route-eth#" or i can set ip forwarding in "/etc/sysctl.con" . when you say:
"on Zebra run this script as root after you chmod 755 it"
is this suppose to take me into a file? can you please tell me what file i should be in because when i enter !/bin/bash, i receive the message "-bash: !/bin/bash: event not found" . is there set-up from the cl.
i previously set ip-forwarding and now i set-up a default gw in jinan to 192.168.5.5 which is connected to the internet. i checked netstat in jinan and i confirmed that gateway 192.168.5.5 was added:
Destin Gateway Genmask Flg MSS window irtt Iface
0.0.0.0 192.168.5.5 0.0.0.0 UG 0 0 0 eth0

i am working on the part of accessing the internet from jinan via zebra. The setting so far did not do it. i appreciate more info from foo_bar_foo or other memebers.

Adony 01-30-2005 10:51 AM

"on Zebra run this script as root after you chmod 755 it"
is this suppose to take me into a file? can you please tell me what file i should be in because when i enter !/bin/bash, i receive the message "-bash: !/bin/bash: event not found"

You can't type that directly on your terminal ...
You have to copy the script to a text file, save it, change its mod to executable (via chmod 755 file) and then run that file (maybe as root as you are using /sbin/ )...

Hope that helps

lumba 01-31-2005 06:02 AM

NFS is fixed. i am able to mount and access any file in Zebra from Jinan. thanks to you guys, i feel good and i start liking linux.
i am still unable to access the internet from jinan. while i am working on this problem, i would appreciate someone explainning the theory of accessing the lan client-server internet in terms of eth cards and loop-back ip address. i have the default gateway set in jinan to be zebra's address 192.168.5.4.


All times are GMT -5. The time now is 02:30 AM.