tuklusan

decnet-bridge-tap-vde-setup.sh - Bridge, VDE and Tun/Tap Network Device Setup Script to run emulator

May 20th, 2023 (edited)
1,517
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.69 KB | Source Code | 0 0
  1. #!/bin/sh
  2. # ---
  3. # decnet-bridge-tap-vde-setup.sh
  4. # ---
  5. # Bridge, VDE and Tun/Tap Network Device Setup Script to run emulators.
  6. # Makes the DECnet/AppleTalk NIC available to emulators.
  7. #
  8. # Basically does this:
  9. #
  10. #   -------
  11. #  |Network|
  12. #  |Adapter|
  13. #  |enp0s3 |
  14. #   -------
  15. #      |           ---------
  16. #       ----------|bridge  `|
  17. #                 |br-dnet `|
  18. #                  ---------`
  19. #                    |         --------
  20. #                    |--------|dnettap0| <--> For use by TBD emulator
  21. #                    |         --------
  22. #                    |
  23. #                    |         ----------
  24. #                     --------|VDE Switch| (Virtual Distributed Ethernet switch)
  25. #                              ----------
  26. #                              |
  27. #                              |  -------------
  28. #                              |-|vde-dnet-tap0| <--> Available to more TBD emulators
  29. #                              |  -------------
  30. #                              |
  31. #                              |  -------------
  32. #                              |-|vde-dnet-tap1| <--> DEC AlphaServer ES40 emulator
  33. #                              |  -------------
  34. #                              |
  35. #                              |  -------------
  36. #                              |-|vde-dnet-tap2| <--> Basilink II Mac-IIci emulator
  37. #                              |  -------------
  38. #                              |
  39. #                              |  -------------
  40. #                              |-|vde-dnet-tap3| <--> PDP-10 TOPS-20 (TWENEX) KLH10 emulator
  41. #                              |  -------------
  42. #                              |
  43. #                              |  -------------
  44. #                              |-|vde-dnet-tap4| <--> Available to more TBD emulators
  45. #                              |  -------------
  46. #                              |
  47. #                              |  -------------
  48. #                              |-|vde-dnet-tap5| <--> DECnet/Python
  49. #                              |  -------------
  50. #
  51. # More details:
  52. # http://supratim-sanyal.blogspot.com/2018/10/bionic-beaver-on-zarchitecture-my.html
  53. # http://tuklusan.decsystem.org
  54. #
  55. # Licensed under "THE BEER-WARE LICENSE" (Revision 42):
  56. # Supratim Sanyal <https://goo.gl/FqzyBW> wrote this file. As long as
  57. # you retain this notice you can do whatever you want with this stuff.
  58. # If we meet some day, and you think this stuff is worth it, you can buy
  59. # me a beer in return.
  60. # ---
  61.  
  62. DEVICE="enp0s8"
  63.  
  64. # ----
  65. # No more changes should be required from here
  66. # ----
  67.  
  68. ip tuntap add dnettap0 mode tap user localuser                     # TAP interface for use by emulators
  69. ip link set dnettap0 arp off
  70.  
  71. # ---
  72. # Also create a VDE switch with TAP plugs for use by simuators
  73. # ---
  74.  
  75. #
  76. vde_switch -t vde-dnet-tap0 -s /tmp/vde-dnet.ctl -m 666 --mgmt /tmp/vde-dnet.mgmt --mgmtmode 666 --daemon --fstp # spare plug
  77. ip link set vde-dnet-tap0 arp off
  78.  
  79. vde_plug2tap -s /tmp/vde-dnet.ctl -m 666 -d vde-dnet-tap1    # AlphaServer ES40
  80. #ip link set vde-dnet-tap1 address AA:00:04:00:1B:XX arp off
  81. ip link set vde-dnet-tap1 arp off
  82.  
  83. vde_plug2tap -s /tmp/vde-dnet.ctl -m 666 -d vde-dnet-tap2    # Basilink II MacOS 7
  84. ip link set vde-dnet-tap2 address AA:00:04:00:1B:7C arp off  # MACOS7 DECnet Address is 31.27
  85.  
  86. vde_plug2tap -s /tmp/vde-dnet.ctl -m 666 -d vde-dnet-tap3    # TWENEX: TOPS-20 DECnet Address is 31.29 and IP Address is 192.168.217.3
  87. ip link set vde-dnet-tap3 address AA:00:04:00:1D:7C arp off  # Access by IP is NOT the goal; putting it on DECnet is. Assigning the gateway IP 192.168.217.3 to this tap results in all sorts of VDE Decnet issues across this and other hosts
  88.                                                              # (MACOS9 on Moksha has IP 192.168.217.2, a DECnet VDE plug on Moksha
  89.  
  90. vde_plug2tap -s /tmp/vde-dnet.ctl -m 666 -d vde-dnet-tap4    # Unused, avaiable
  91. #ip link set vde-dnet-tap4 address AA:00:04:00:25:XX arp off
  92.  
  93. vde_plug2tap -s /tmp/vde-dnet.ctl -m 666 -d vde-dnet-tap5    # DECnet/Python
  94. ip link set vde-dnet-tap5 address AA:00:04:00:FD:7F arp off  # DECnet Address: 31.1021
  95.  
  96. # Create a Bridge
  97. ip link add name br-dnet type bridge
  98. ip link set br-dnet arp off
  99. brctl stp br-dnet on
  100.  
  101. # Bridge the NIC $DEVICE, the TAP device and VDE Switch TAP0 plug
  102. ip link set $DEVICE master br-dnet
  103. ip link set dnettap0 master br-dnet
  104. ip link set vde-dnet-tap0 master br-dnet
  105.  
  106. # Bring everything back up
  107. ip link set $DEVICE arp off
  108. ip link set dev br-dnet up
  109. ip link set dev dnettap0 up
  110. ip link set vde-dnet-tap0 up
  111. ip link set vde-dnet-tap1 up
  112. ip link set vde-dnet-tap2 up
  113. ip link set vde-dnet-tap3 up
  114. ip link set vde-dnet-tap4 up
  115. ip link set vde-dnet-tap5 up
  116.  
  117. brctl show
  118.  
  119. # --
  120. # We can now attach simulators
  121. # --
Advertisement
Comments
  • raj20us
    3 years
    Comment was deleted
Add Comment
Please, Sign In to add comment