Skip to content

Instantly share code, notes, and snippets.

@tonosaman
Created October 24, 2016 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonosaman/d00d6c919b59c0268a50970aed380c69 to your computer and use it in GitHub Desktop.
Save tonosaman/d00d6c919b59c0268a50970aed380c69 to your computer and use it in GitHub Desktop.
ストレートEtherケーブル直結構成(with MDI-X)の備忘録

Howto PC-to-PC direct connect with strait ether-cable.

MDI-X: HUB不要でストレート直結可能

片方でもNICがMDI-XをサポートしていればストレートEtherケーブルを繋いで通信可能。

+-----+  ether cable +--------+
| p70 |--------------| sh76en |
+-----+              +--------+
hostname interface ipaddr MDI-X
p70 enp0s31f6 10.2.64.1 on (auto)
sh76en enp10s0 10.2.64.10 N/A

routing on sh76en

sh76en% ethtool enp10s0 | grep MDI-X
# No MDI-X capability
sh76en% sudo ifconfig enp10s0 10.2.64.10/8
sh76en% sudo route add -host 10.2.64.1 dev enp10s0
sh76en% route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.2.64.1       0.0.0.0         255.255.255.255 UH    0      0        0 enp10s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp10s0
(snip)

routing on p70

p70% ethtool enp0s31f6 | grep MDI-X
MDI-X: on (auto)
p70% sudo ifconfig enp0s31f6 10.2.64.1/8
p70% sudo route add -host 10.2.64.10 dev enp0s31f6
p70% route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 enp0s31f6
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp0s31f6

疎通確認

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment