Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
08-08-2004, 12:36 PM
|
#1
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Rep:
|
problem to ping on my LAN
hi all!
i m trying to set up a LAN for my LAB using redhat 9.0
all pc have there own ip
name=lab1
one pc has the ip=192.168.1.1
and netmask = 255.255.255.0
OS redhat 9.0
and the other pc is having
name = lab2
ip=192.168.1.2
netmask=255.255.255.0
OS fedora 2.0
but i m not able to ping the machine from lab1 to lab2 or viceversa
what addition setting are required.....
i m new to linux world....so pl explain in detail
tia
|
|
|
08-08-2004, 01:40 PM
|
#2
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
check firewall and make sure about cables.
u can stop firewall with
#/etc/init.d/iptables stop
command
|
|
|
08-08-2004, 01:46 PM
|
#3
|
Member
Registered: Aug 2004
Location: U.S
Distribution: Ubuntu
Posts: 145
Rep:
|
first thing to do is to check your LAN cable.
Secondly, did you restart the network services after assigning IPs?
well if you did'nt then you can restart them with the command
service network restart
Thirdly once i was also having a similar problem with fedora core 2.
Then i typed this command to put my fedora on the network
modprobe e100
|
|
|
08-08-2004, 02:27 PM
|
#4
|
Member
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365
Rep:
|
Question 1 Are you pinging by IP address or by the name?
If you can ping by IP address, but not name, then it is a simple means of making entries into the /etc/hosts file
127.0.0.1 localhost.localdomain localhost
192.168.1.1 lab1
192.168.1.2 lab2
However, if you can not ping by IP address either, then you have a network issue. Can I assume these machines are connected via a hub or switch?
Type ifconfig and confirm the IP addresses are set there.
It never hurts to restart the network daemon
/etc/init.d/network restart
I think u said these were Red Hat boxes, so service network restart will work also.
Type route and make sure you see
192.168.1.0 listed in there
|
|
|
08-09-2004, 01:34 AM
|
#5
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Original Poster
Rep:
|
thanks for all these replies.....i had tried all these...but it is still the same
my one PC lab1 has to NICs eth0 & eth1
the eth0 is connected to my extenal LAN
name=lab1
IP=172.28.39.46
netmask=255.255.0.0
gateway=172.28.1.254
i m making my LAN thru eth1
name=lab1
IP=192.168.1.1
netmask=255.255.255.0
gateway=
with ifconfig command it is showing both NICs
i m able to connect to my extenal LAN thru eth0
but with eth1 i m not able to connect to connect to my own LAN...
both the lights on eth1 card are not blinking......(actually i was thinking to make lab1 PC as router later if my intenal LAN is working properly
i m trying to ping my own LAN with ip numbers......
but it is giving the message "destination host unreachable"
same message from lab2 PC........
pl help me out of this......
tia
|
|
|
08-09-2004, 07:45 AM
|
#6
|
LQ Newbie
Registered: Aug 2004
Location: Hyderabad
Distribution: RH, fedora
Posts: 19
Rep:
|
R u directly connecting both the PC's (lab1 , lab2) ?? or u using a hub in between ??
|
|
|
08-09-2004, 12:16 PM
|
#7
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Original Poster
Rep:
|
i m using hub in between and the cable is not cross-over these are straight-through
thru 'ifconfig' command
my lab1 PC (it has 2 NICs) gives Rx=0 and some values for Tx on eth1 (my LAN side) link
and values for both on eth0 (for external LAN) link
and my lab2 PC gives some value for both Rx & Tx on eth0 link
i heard that it should be some value other then 0 for a proper connection....
|
|
|
08-11-2004, 08:44 AM
|
#8
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Original Poster
Rep:
|
does i have to make some entries in to the lab1 PC so that it can recognize the traffic in my LAB LAN side...because it is able to communicate on external LAN side
|
|
|
08-11-2004, 09:42 AM
|
#9
|
Member
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365
Rep:
|
I'm not sure what you are asking, so bear with the long response please.
You have two machines
lan1 192.168.1.1 netmask 255.255.255.0
lan2 192.168.1.2 netmask 255.255.255.0
They are directly connected via a hub.
You can not ping lan1 from lan2 or lan2 to lan1
The lights on the hub are on correct?
Can can ping localhost on each machine?
Can you ping lan1's IP Address from lan1?
Can you ping lan2's IP Address from lan2?
I would suggest you try everything using IP addresses first.
Maybe to narrow down what interface is being used on lan2 to do the pinging.
ping -I 192.168.1.2 192.168.1.1
This way lan2 won't try to ping using the interface on the public net.
If noe of the above are issues, Now you can share your connection out.
Now, suppose lan2 is the box with the second ethernet connection. It is a public address and you can reach the internet via that connection. Correct?
If you want the private addresses to reach the internet, you will need to do some masquerading.
I assume this is what you are striving for. If not, then you can skip everything else.
First, you will need to enable lan2 as a router.
echo "1" > /proc/sys/net/ipv4/ip_forward
Then, you need to do some masuerading
iptables -t nat -A POSTROUTING -d ! 192.168.1.0 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.0 -j ACCEPT
iptables -A FORWARD -d 192.168.1.0 -j ACCEPT
iptables -A FORWARD -s 127.0.0.1 -j ACCEPT
Usually, you would put those lines all in a script.
|
|
|
08-13-2004, 07:43 AM
|
#10
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Original Poster
Rep:
|
thanks!
now i can ping my lab's PCs
but after entering the entries in the iptables as given above
my LAb1 PC which is acting as router is not able to ping to the outside LAN
nor my any of the PCs ( which are on my ownLAB LAN side) can ping the outside LAN .
but if i comment these entries in the iptables and restart the iptables n network, then i can ping the outside LAN from my LAB1 PC(router PC) but not from the other PCs in my LAB LAN......
with the first entry as
-t nat -A postrouting -d ! 192.168.1.0 -j MASQUERADE
iptables does not restart and give the following error
iptables-restore v1.2.7a: line 20 seems to have a -t table option
try iptables-restore -h or iptables-restore --help for more information
but if i comment this entry, iptable can be restarted, with other entris ...but does not ping outside LAN
what other entries/modifications i have to make in the iptables.....
tia
|
|
|
08-13-2004, 09:13 AM
|
#11
|
Member
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365
Rep:
|
Woops
The postrouting is all caps!
iptables -t nat -A POSTROUTING etc etc etc
|
|
|
08-15-2004, 12:42 AM
|
#12
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Original Poster
Rep:
|
i have tried 'POSTROUTING' as all caps...even then the message is same....
what to do....
tia
|
|
|
08-15-2004, 08:37 AM
|
#13
|
Member
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365
Rep:
|
I think it is just a matter of sytax
iptables -t nat -A POSTROUTING -d !192.168.1.0 -j MASQUERADE
Youn see if it is in place by viewing that tables data
iptable -t nat -L
|
|
|
08-16-2004, 02:48 AM
|
#14
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Original Poster
Rep:
|
i tried that too but still the message is same.....i m still not able to ping my external LAN from my LAB LAN....only the PC which has two NICs can ping the outside LAN not other PCs...
pl. help me to come out of this situation....
tia
|
|
|
08-16-2004, 06:48 PM
|
#15
|
Member
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365
Rep:
|
OK, your machines on the internal lan....
They do have the default route set to the machine that has the 2 nics right?
if not, try
route add default gw 192.168.whatever.whatever
I didnt read back, but I think it was 192.168.1.1 or something like that. (The IP of the machine that can reach the internet)
|
|
|
All times are GMT -5. The time now is 12:54 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|