Network Connection between Two Hosts

Network Connection between Two Hosts http://www.djack.com.pl/Suse9hlp/ch16s04.html#sec:pcmcia.btooth.ex.net

The first example shows the establishment of a network connection between two hosts with pand (personal area networking). The following commands must be executed by the user root. The description focuses on the Bluetooth-specific actions and does not provide a detailed explanation of the network command (ip).

Start pand with the command pand -s on one of the two hosts (referred to as H1). Determine the device address of the second host (H2) by running hcitool inq on this host. Run pand -c <device_address> to establish a connection. If you query the available network interfaces with ip link show, an entry such as the following should be displayed (the local device address should be displayed instead of 00:12:34:56:89:90):

bnep0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:12:34:56:89:90 brd ff:ff:ff:ff:ff:ff

This interface must be assigned an IP address and activated. This can be done with the following two commands. On H1:

ip addr add 192.168.1.3/24 dev bnep0
ip link set bnep0 up

On H2:

ip addr add 192.168.1.4/24 dev bnep0
ip link set bnep0 up

Now H1 can be accessed from H2 under the IP 192.168.1.3. Use the command ssh 192.168.1.4 to access H2 from H1 (provided H2 runs an sshd, which is activated by default in SUSE LINUX). The command ssh 192.168.1.4 can also be run as a normal user.

你可能感兴趣的:(#Phone)