LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-23-2005, 06:59 AM   #1
lumba
Member
 
Registered: Dec 2004
Location: USA
Distribution: redhat9
Posts: 53

Rep: Reputation: 15
lan network can't ping each othet


I installed Fedora core 3 in two computers. I called one of them "jinan" which has two ethernet cards and the other called "zebra" has one ethernet card. Jinan ethernet cards ip addresses were etho 192.168.5.1 and eth1 192.168.5.2. i created an xdsl connection to the internet on etho and it is working fine. I configured the ip address in Zebra to be 192.168.5.4. I made a crossover cable connection between the two boxes and made a small lan.
I was able to ping 192.168.5.4 from jinan. I was also able to ping 192.168.5.2 from zebra, but I wasn't able to ping 192.168.5.1 from neither Zebra nor from its host "Jinan". I changed etho address to 192.168.5.5. and rebooted both systems. Now I can ping both of jinans' cards from jinan and I also could ping Zebra's card from Zebra. but I can't ping anything from zebra to jinan or vice versa. I don't know how changing the address of one cards in jinan made the lan completly unaccessible.
i was hoping at least the ping part should be striaght forward job .
Appreciate your help.
 
Old 01-23-2005, 07:29 AM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: Ubuntu, FreeBSD, NetBSD
Posts: 1,449

Rep: Reputation: 47
Do not set the ip address of eth0 to a local ip number if it is going to connect to the internet.
 
Old 01-23-2005, 08:02 AM   #3
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 54
zebra's default gateway needs to be jinan's address.
also you may need to set up NAT

Last edited by comprookie2000; 01-23-2005 at 08:12 AM.
 
Old 01-23-2005, 06:11 PM   #4
lumba
Member
 
Registered: Dec 2004
Location: USA
Distribution: redhat9
Posts: 53

Original Poster
Rep: Reputation: 15
thanks for the input.
i changed etho ip address to 192.168.4.4 and the ping worked, but I couldn't ping neither machines using their host names only. Before I originally made any changes, i was able to ping both hosts using their names only. I thought configuring nfs or samba shared directories is not useful before figuring out the pre-requisite set-up, but i tried both of them anyway without being able to access the shared directories.
i would like to ask frob23 if assigning etho the new address would still make the internet service available to the other computer, Zebra.
i appreciate frob23 and comprookie's feedback and just to make sure, jinan's address is eth1, right?
 
Old 01-23-2005, 07:31 PM   #5
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 54
Here is how mine is set up with a crossover cable;

internet[192.168.1.254]modem[192.168.1.97]abbottdavid(eth0)[192.168.0.1]&(eth1)[192.168.0.2] comprookie[eth0](192.168.0.2)comprookie default gateway is(192.168.0.1)abbottdavid default gateway is(192.168.1.254)I tried to make a nice diagram but it was bad,real bad!

For abbottdavid you need to link the cards together
this is for gentoo
# ln -s net.eth0 /etc/init.d/net.eth1
and for iptables
Code:
First we flush our current rules
# iptables -F
# iptables -t nat -F

Then we lock our services so they only work from the LAN
# iptables -I INPUT 1 -i eth0 -j ACCEPT
# iptables -I INPUT 1 -i lo -j ACCEPT
# iptables -A INPUT -p UDP --dport bootps -i ! eth0 -j REJECT
# iptables -A INPUT -p UDP --dport domain -i ! eth0 -j REJECT

(Optional) Allow access to our ssh server from the WAN
# iptables -A INPUT -p TCP --dport ssh -i eth1 -j ACCEPT

Drop TCP / UDP packets to privileged ports
# iptables -A INPUT -p TCP -i ! eth0 -d 0/0 --dport 0:1023 -j DROP
# iptables -A INPUT -p UDP -i ! eth0 -d 0/0 --dport 0:1023 -j DROP

Finally we add the rules for NAT
# iptables -I FORWARD -i eth0 -d 192.168.0.0/255.255.0.0 -j DROP
# iptables -A FORWARD -i eth0 -s 192.168.0.0/255.255.0.0 -j ACCEPT
# iptables -A FORWARD -i eth1 -d 192.168.0.0/255.255.0.0 -j ACCEPT
# iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
Tell the kernel that ip forwarding is OK
# echo 1 > /proc/sys/net/ipv4/ip_forward
# for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do echo 1 > $f ; done

This is so when we boot we don't have to run the rules by hand
# /etc/init.d/iptables save
# rc-update add iptables default
# nano /etc/sysctl.conf
Add/Uncomment the following lines:
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
You may not need it all but for sure ipforwarding,you can do it with firestarter or guarddog.
Again this is for gentoo but will give you an idea,good luck

Last edited by comprookie2000; 01-23-2005 at 07:45 PM.
 
Old 01-28-2005, 10:13 AM   #6
lumba
Member
 
Registered: Dec 2004
Location: USA
Distribution: redhat9
Posts: 53

Original Poster
Rep: Reputation: 15
thanks for the reference comprookie, it helped a lot.
onr of the things i did, i added the host names in /etc/hosts with the corresponding ethenet card ip address and i was able to ping both machines by names.
 
  


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
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 13 03-17-2011 03:47 AM
can ping network computer, cannot ping google.com (help needed) ben_build#2.1.0 Linux - Wireless Networking 23 11-07-2010 01:55 PM
Any idea why this time I can not ping my LAN pc but can PING for ex. www.yahoo.com vakia Debian 5 09-28-2005 07:42 PM
can't ping to outside LAN emailssent Linux - Networking 7 09-30-2004 07:37 AM
Can ping network but can't ping any internet ip when I hard set the ip Streme Linux - Wireless Networking 4 04-13-2004 10:18 AM


All times are GMT -5. The time now is 12:27 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration