Click here to Skip to main content
15,886,772 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to give static ip of both my windows server n linux server but when i do this then my default gateway shows Destination Host Unreachable in linux when i ping it in linux tell me what can i do now?

my windows server settings are
ipv4 address 192.168.1.68
ipv4 subnet 255.255.255.0
ipv4 default gateway 192.168.1.1

and my linux server settings are
eth0 Link encap:Ethernet HWaddr 00:0C:29:6B:E9:8A
inet addr:192.168.178.128 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe6b:e98a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44949 errors:0 dropped:0 overruns:0 frame:0
TX packets:34250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:30998896 (29.5 MiB) TX bytes:1860368 (1.7 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:231 errors:0 dropped:0 overruns:0 frame:0
TX packets:231 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:23426 (22.8 KiB) TX bytes:23426 (22.8 KiB)
Posted
Comments
macika123 13-Mar-15 13:46pm    
Could you please describe, how the servers are physically connected to the network? It seems to me, that the only solution is using a router between the subnets, that has two IP addresses (one in each subnet).

If this is an home network, and you don't have enaugh network knowledge, simply choose static ip's in the same subnet, that is all numbers which value in the mask is one, must be the same.
In your case the subnet is 192.168.1.xxx (mask 255.255.255.0), so simply set the address with this 3 numbers changing only the last one.
I.E. If you windows machine has address 192.168.1.68 you can assign to Linux server 192.168.1.128.
Or the reverse: Linux=192.168.178.128 Windows=192.168.178.68 (using the linux subnet 192.168.178.xxx)
I sugggest to use the first solution in favour of the more standard 192.168.1.xxx private address.
When devices of different subnets have to talk each other you have to install a device called router, it has two network ports, one on a subnet and the other on the second network, which scope is to route packets between the two networks.
 
Share this answer
 
v4
Comments
Member 11512871 17-Mar-15 5:52am    
i did the same thing which you told me i gave the ip address of 192.168.1.68 to my windows machine and 192.168.1.128 to my linux server but my default gateway which is 192.168.1.1 not ping in linux and it shows "Destination Host Unreachable" and also when i ping google.com in linux then it shows host unknown. What i do now????
Frankie-C 17-Mar-15 6:51am    
What is your physical connection between machines? Like the one below?
<pre lang="text">
+-------- +
+----+ Windows | 192.168.1.68
+----------+ +--------+ | +---------+
| Gateway +----+ switch +-----+
+----------+ | +-----+
192.168.1.1 +--------+ | +----------+
+---+ Linux | 192.168.1.128
+----------+
</pre>
If you ping the Linux server from windows can you see it?
And the reverse?
From windows machine is all ok?
Are you sure that the Linux server IP address is effectively 192.168.1.128 ?
What is your physical connection between machines? Like the one below?
C++
                                    +-------- +
                               +----+ Windows | 192.168.1.68
+----------+    +--------+     |    +---------+
|  Gateway +----+ switch +-----+
+----------+    |        +-----+
 192.168.1.1    +--------+     |   +----------+
                               +---+  Linux   | 192.168.1.128
                                   +----------+

If you ping the Linux server from windows can you see it?
And the reverse?
From windows machine is all ok?
Are you sure that the Linux server IP address is effectively 192.168.1.128 ?
I'm using solution space to make graph readable.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900