LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-26-2008, 09:16 AM   #1
man2000
LQ Newbie
 
Registered: Apr 2008
Posts: 6

Rep: Reputation: 0
accessing server of different class


i want to access/ping window xp machine of ip address 192.168.1.2 and 150.0.117.2 from linux machine of ip 150.0.127.1.
i can ping 150.0.117.2 from 150.0.127.1 but unable to ping 192.168.1.2
how can i ping it

please help me
 
Old 04-26-2008, 10:10 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Is there a gateway router or host to the 192.168.1.0 network? If you have hosts on the physical network (plugged into the switch) you could set up a virtual interface with an IP address in the 192.168.1.0 address space.

ifconfig eth2:1 10.10.0.100 netmask 255.255.255.0

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
jesnet          *               255.255.255.128 U     0      0        0 eth2
10.10.0.0       *               255.255.255.0   U     0      0        0 eth2
loopback        *               255.0.0.0       U     0      0        0 lo
default         router          0.0.0.0         UG    0      0        0 eth2
Here I ssh'ed into my desktop; added a virtual IP address on it as well and then pinged back:
Code:
ifconfig eth0:1 10.10.0.101 netmask 255.255.255.0
hpmedia:~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
jesnet          *               255.255.255.128 U     0      0        0 eth0
10.10.0.0       *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         router          0.0.0.0         UG    0      0        0 eth0
hpmedia:~ # ping 10.10.0.100
PING 10.10.0.100 (10.10.0.100) 56(84) bytes of data.
64 bytes from 10.10.0.100: icmp_seq=1 ttl=64 time=7.32 ms
64 bytes from 10.10.0.100: icmp_seq=2 ttl=64 time=0.222 ms
64 bytes from 10.10.0.100: icmp_seq=3 ttl=64 time=0.225 ms

--- 10.10.0.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
 
Old 04-26-2008, 11:36 AM   #3
man2000
LQ Newbie
 
Registered: Apr 2008
Posts: 6

Original Poster
Rep: Reputation: 0
problem remains

i have set virtual ip to eth0 as 192.168.1.5 and 150.0.117.5 and
try
route add 198.168.1.2 gw 150.0.127.2(ip of windows xp)

but when i ping to 198.168.1.2 it hangs

why this is
please help

Last edited by man2000; 04-26-2008 at 11:40 AM.
 
Old 04-26-2008, 01:01 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You want eth0:1 as 192.168.1.5. Don't change the default gateway. Note the ":1" after eth0. That is the notation for a virtual interface.

Code:
sudo /sbin/ifconfig eth0:1 192.168.1.5 netmask 255.255.255.0
If you then enter in "/sbin/route", you should see that there is a route for the 192.168.1.0 network on eth0:1.

---

This is if the 192.168.1.2 computer is on the same network segment. In other words, if both computers are plugged into the same switch.


If the windows machine bridges two networks, and the windows machine isn't the default gateway, then you would simply add a route. You wouldn't create a virtual device because you need to be on the same network as the windows gateway interface:
Code:
route add -net 192.168.1.0/24 gw 150.0.127.2 dev eth0
There is a Network Administrator's Guide (nag.pdf) book on the www.tldp.org website. I highly recommend it.

Last edited by jschiwal; 04-26-2008 at 01:12 PM.
 
Old 04-27-2008, 01:34 AM   #5
man2000
LQ Newbie
 
Registered: Apr 2008
Posts: 6

Original Poster
Rep: Reputation: 0
problem remains

i did what you have said
but when i pinging to 192.168.1.2 it hangs not returned anything
i also search for nag.pdf i couldnt find

thanks for help in advance
 
Old 04-27-2008, 04:25 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Here is a link to the guide:
http://www.tldp.org/LDP/nag2/nag2.pdf

This is the second edition. The third edition is in the book stores. This is the 2nd edition of the same book.

You need to describe where on the network that the 192.168.1.2 host is. Can that host ping your virtual NIC?
The structure of the network may indicate what you need to do. Without further info, I have been assuming that the 192.168.1.2 machine is on the same LAN segment, but using a different network IP address.

Enter "sudo /sbin/ifconfig" and see if the virtual nic is listed.

Code:
I performed the steps on two computers on my LAN.  
Since I already was running my network on 192.168.1.0, 
I used 10.10.0.0 instead for my demo.  I could ping back and forth.

eth2:1    Link encap:Ethernet  HWaddr 00:04:5A:9D:D6:E8
          inet addr:10.10.0.100  Bcast:10.10.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0x3000
Also, the firewall on the 192.168.1.2 computer may be dropping all ping requests.
 
Old 04-28-2008, 09:22 AM   #7
man2000
LQ Newbie
 
Registered: Apr 2008
Posts: 6

Original Poster
Rep: Reputation: 0
problem

both pc and linux box connected to same switch
but my 150.0.117.2(ip of xp) can ping 150.0.127.1 (ip of linux )and
192.168.1.3(ip provided by isp on windows xp) can not ping 192.168.1.5(virtual ip of linux)
 
Old 04-29-2008, 08:20 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Does the windows XP machine have two interfaces? If the first NIC on the XP is connected to your modem, then there isn't a connection there, but since you can connect using the second NIC why do you need a virtual IP on the Linux box.

I had been thinking that there were at least 3 computers on the LAN and one had an IP address of 192.168.1.3.
 
  


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
Reliable server-class drives fw12 Linux - Hardware 3 09-21-2007 06:44 PM
C++ templated Node class: pointers to different instantated class types jhwilliams Programming 3 08-20-2007 06:20 PM
Does derivated class inherit base class destructor (constructor)? kornerr Programming 2 08-23-2006 08:05 AM
Which C++ editor in Linux has the class view/class browser feature imaginationworks Programming 7 05-21-2006 11:09 PM
Java help (accessing array elemonts from another class or method) Tru_Messiah Programming 6 05-14-2004 09:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:49 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