how to connect two Linux machines (one over wifi and other over ethernet) via ADSL modem

1

I have a ADSL modem (DLink 2730u) and two PCs one of which is connected to the modem on the ethernet and the other PC is connected to the same modem on wifi. Both PCs are running Debian Wheezy Linux.

I want to be able to ssh from one PC to other in this setup. Both PCs are on the same LAN with the addresses given below -

PC1 - 192.168.1.24
PC2 - 192.168.1.56

the gateway is modem and its IP address is 192.168.1.1

Both computers can access the gateway,

But I cannot ping one PC from the other. How do I set up my modem and the PCs so as to be able to connect the PCs with each other? How do I add a path so that the PCs get connected to each other?

mntk123

Posted 2015-12-10T15:14:42.360

Reputation: 163

Answers

1

[non native English poster] Usually, in a domestic grade router/switch/AP device, the WiFi and ethernet are on two different physical interfaces. One interface for all the wired connections (WAN and LAN) and the other one for WiFi (WLAN). The first interface is divided in two vlan's, one for WAN (wired internet) and the other vlan is for the LAN (all the switch ports of your wired internal network). That second vlan should be bridged in some way with the physical interface providing WiFi. If that bridge does not exists or has been disabled in your D-Link, than you might not be able to connect wired and wireless device together, even if they belong to the same subnet.

Here is a typical router diagram (from openWrt.org). See the br0 bridge?

https://wiki.openwrt.org/_media/oldwiki/openwrtdocs/asus-internals-default.png

Check if you can find any option in the D-Link config to bridge wireless to the wired switch ports.

[edit] I just found a D-Link User Manual on the net. Verify that the option "Enable MultiAP Isolation" is not checked in the Wireless Setup page.

ripat

Posted 2015-12-10T15:14:42.360

Reputation: 236

this is very useful information – mntk123 – 2015-12-30T14:56:05.490

1

If you cannot ping the machines you are probably not on the same internal network. Maybe try arp -n to show you which machines each computer can see. If the machine is not there, the problem is probably your router/routing. If possible, try resetting your router and see if that fixes the problem. Also check to make sure both computers can access the gateway.

Edit: You might try logging into your router and making sure the router sees both devices with their respective IPs. I have had a similar problem before when assigning static IPs in linux.

Silvertail

Posted 2015-12-10T15:14:42.360

Reputation: 61

both computers can access the gateway, and from their IP's (given above) I guess, they are on the same network - correct me if I am wrong. – mntk123 – 2015-12-10T17:04:12.593

edited the question, and from both PCs gateway is accessible. – mntk123 – 2015-12-10T17:31:22.810

0

Can you ping each host from the other one. So for example, ssh into 192.168.1.24 and ping the gateway ping 192.168.1.1, if you can ping the gateway then try pinging the other host ping 192.168.1.56. Also, are they statically IP'd or dynamically?

Ahmad

Posted 2015-12-10T15:14:42.360

Reputation: 1

I can ping the gateway from each host BUT cannot ping the other host from any host. The IPs are assigned statically using ip command. – mntk123 – 2015-12-11T03:19:02.520

I am not sure which version of linux you are running, but you might need to add more informations to your network interfaces file. So, open vi /etc/network/interfaces file and edit/add the following information under iface eth0 inet static: address 192.168.1.x (x is the IP of that host you are editing) netmask 255.255.255.0 gateway 192.168.1.1 network 192.168.1.0 dns-nameservers 192.168.1.1 8.8.8.8

now reboot your server. Do the above for both of those servers and try again. – Ahmad – 2015-12-11T20:21:14.167