As there is no routing device between the two, you need to assign an IP address for each of them, additionally being both in the same subnet. So, for example, you can assign the IP address (assuming these are not used, otherwise, you need to choose a different LAN segment):
192.168.100.1
and 255.255.255.0
to the Windows box.
192.168.100.2
and 255.255.255.0
to the Linux box.
For the windows machine:
- Right click on the interface you refer on the snapshot, and click
Properties
.
- Click on
Internet Protocol Version 4 (IPv4)
- Click on
Use the following IP address
- As the IP address field, enter
192.168.100.1
(or a different one if this is already been used)
- As the subnet mask, enter
255.255.255.0
For the linux machine:
You need to find out which interface matches your physical interface. To do that, you can access the /etc/sysconfig/network-scripts
directory and run ls ifcfg-*
. You'll get one file for each network address card you have. To edit the settings of the one that is connected, assuming it's called ifcfg-eth0
, you would run vi ifcfg-eth0
(vi
is the editor, you can use nano
or pico
or whatever you feel comfortable with), and put a content like this:
DEVICE="eth0"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.100.2
NETMASK=255.255.255.0
Then you just need to run:
ifdown eth0 && ifup eth0
There's no need for a gateway since as said there's no routing (and is not needed).
Now, on the linux box, you need to make sure that the sshd
daemon is listening to that interface too. You can check that running:
netstat -atpn
And see what is the local address for SSH. It should be something like 0.0.0.0:22
. That would mean it listens to all interfaces, which is what you need. If not, you'll need to edit your /etc/ssh/sshd_config
file and make it listen for this P2P interface as well.