Když je potřeba do jednoho kabelu dát dva a více ethernetů. :-) Vytvoříme VLAN.
Příklad PC + RPi:
RPi zakomentovat /etc/network/interface.d/eth0
vytvořit /etc/network/interface.d/vlan
auto eth0.10
iface eth0.10 inet static
address 192.168.1.195
netmask 255.255.255.0
iface eth0.10 inet static
address 192.168.1.195
netmask 255.255.255.0
na druhé straně podobně:
auto eth0.10
iface eth0.10 inet static
address 192.168.1.195
netmask 255.255.255.0
iface eth0.10 inet static
address 192.168.1.195
netmask 255.255.255.0
Výpis ip addr:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:7d:d1:76 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 36:1c:f9:d9:85:ae brd ff:ff:ff:ff:ff:ff permaddr b8:27:eb:28:84:23
7: eth0.10@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b8:27:eb:7d:d1:76 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.195/24 brd 192.168.1.255 scope global secondary eth0.10
valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fe7d:d176/64 scope link
valid_lft forever preferred_lft forever
8: eth0.1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b8:27:eb:7d:d1:76 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.191/24 brd 192.168.1.255 scope global eth0.1
valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fe7d:d176/64 scope link
valid_lft forever preferred_lft forever
Příklad logu komunikace:
Žádné komentáře:
Okomentovat