Guest User

Untitled

a guest
Feb 17th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.70 KB | None | 0 0
  1. VM -- (eth0)RPI(wlan0) -- Router -- ISP
  2. ^ ^ ^ ^
  3. DHCP Static DHCP GW
  4.  
  5. # interfaces(5) file used by ifup(8) and ifdown(8)
  6.  
  7. # Please note that this file is written to be used with dhcpcd
  8. # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
  9.  
  10. # Include files from /etc/network/interfaces.d:
  11. source-directory /etc/network/interfaces.d
  12.  
  13. #auto wlan0
  14. iface wlan0 inet dhcp
  15. wpa-ssid FunBox-84A8
  16. wpa-psk 7A73FA25C43563523D7ED99A4D
  17.  
  18. #auto eth0
  19. allow-hotplug eth0
  20. iface eth0 inet static
  21. address 192.168.2.1
  22. netmask 255.255.255.0
  23. network 192.168.2.0
  24. broadcast 192.168.2.255
  25.  
  26. # Generated by iptables-save v1.6.0 on Sun Feb 17 20:01:56 2019
  27. *nat
  28. :PREROUTING ACCEPT [86:11520]
  29. :INPUT ACCEPT [64:8940]
  30. :OUTPUT ACCEPT [71:5638]
  31. :POSTROUTING ACCEPT [37:4255]
  32. -A PREROUTING -d 192.168.1.21/32 -p tcp -m tcp --dport 170 -j DNAT --to-destination 192.168.2.83:22
  33. -A PREROUTING -d 192.168.1.21/32 -p tcp -m tcp --dport 171 -j DNAT --to-destination 192.168.2.83:443
  34. -A PREROUTING -d 192.168.1.21/32 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 192.168.2.66:3389
  35. -A POSTROUTING -o wlan0 -j MASQUERADE
  36. COMMIT
  37. # Completed on Sun Feb 17 20:01:56 2019
  38. # Generated by iptables-save v1.6.0 on Sun Feb 17 20:01:56 2019
  39. *filter
  40. :INPUT ACCEPT [3188:209284]
  41. :FORWARD ACCEPT [25:2740]
  42. :OUTPUT ACCEPT [2306:270630]
  43. -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
  44. -A FORWARD -i eth0 -o wlan0 -j ACCEPT
  45. COMMIT
  46. # Completed on Sun Feb 17 20:01:56 2019
  47. # Generated by iptables-save v1.6.0 on Sun Feb 17 20:01:56 2019
  48. *mangle
  49. :PREROUTING ACCEPT [55445:38248798]
  50. :INPUT ACCEPT [3188:209284]
  51. :FORWARD ACCEPT [52257:38039514]
  52. :OUTPUT ACCEPT [2306:270630]
  53. :POSTROUTING ACCEPT [54565:38310208]
  54. COMMIT
  55. # Completed on Sun Feb 17 20:01:56 2019
  56. # Generated by iptables-save v1.6.0 on Sun Feb 17 20:01:56 2019
  57. *raw
  58. :PREROUTING ACCEPT [55445:38248798]
  59. :OUTPUT ACCEPT [2306:270630]
  60. COMMIT
  61. # Completed on Sun Feb 17 20:01:56 2019
  62.  
  63. # A sample configuration for dhcpcd.
  64. # See dhcpcd.conf(5) for details.
  65.  
  66. # Allow users of this group to interact with dhcpcd via the control socket.
  67. #controlgroup wheel
  68.  
  69. # Inform the DHCP server of our hostname for DDNS.
  70. hostname
  71.  
  72. # Use the hardware address of the interface for the Client ID.
  73. clientid
  74. # or
  75. # Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
  76. # Some non-RFC compliant DHCP servers do not reply with this set.
  77. # In this case, comment out duid and enable clientid above.
  78. #duid
  79.  
  80. # Persist interface configuration when dhcpcd exits.
  81. persistent
  82.  
  83. # Rapid commit support.
  84. # Safe to enable by default because it requires the equivalent option set
  85. # on the server to actually work.
  86. option rapid_commit
  87.  
  88. # A list of options to request from the DHCP server.
  89. option domain_name_servers, domain_name, domain_search, host_name
  90. option classless_static_routes
  91. # Most distributions have NTP support.
  92. option ntp_servers
  93. # Respect the network MTU. This is applied to DHCP routes.
  94. option interface_mtu
  95.  
  96. # A ServerID is required by RFC2131.
  97. require dhcp_server_identifier
  98.  
  99. # Generate Stable Private IPv6 Addresses instead of hardware based ones
  100. slaac private
  101.  
  102. # Example static IP configuration:
  103. #interface eth0
  104. #static ip_address=192.168.0.10/24
  105. #static ip6_address=fd51:42f8:caae:d92e::ff/64
  106. #static routers=192.168.0.1
  107. #static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
  108.  
  109. # It is possible to fall back to a static IP if DHCP fails:
  110. # define static profile
  111. #profile static_eth0
  112. #static ip_address=192.168.1.23/24
  113. #static routers=192.168.1.1
  114. #static domain_name_servers=192.168.1.1
  115.  
  116. # fallback to static profile on eth0
  117. #interface eth0
  118. #fallback static_eth0
  119.  
  120. denyinterfaces eth0
  121.  
  122. host Accountant {
  123. hardware ethernet 10:60:4b:68:03:21;
  124. fixed-address 192.168.2.83;
  125. }
  126.  
  127. host Accountant1 {
  128. hardware ethernet 00:0c:29:35:95:ed;
  129. fixed-address 192.168.2.66;
  130. }
  131. host Accountant3 {
  132. hardware ethernet 30:85:A9:1B:C4:8B;
  133. fixed-address 192.168.2.70;
  134. }
  135.  
  136. root@gateway:/home/pi# systemctl restart dhcpcd
  137. Warning: dhcpcd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
  138. Job for dhcpcd.service failed because the control process exited with error code.
  139. See "systemctl status dhcpcd.service" and "journalctl -xe" for details.
  140. root@gateway:/home/pi# systemctl status dhcpcd
  141. ● dhcpcd.service - dhcpcd on all interfaces
  142. Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
  143. Drop-In: /etc/systemd/system/dhcpcd.service.d
  144. └─wait.conf
  145. Active: failed (Result: exit-code) since Sun 2019-02-17 20:36:42 GMT; 6s ago
  146. Process: 775 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w (code=exited, status=6)
  147.  
  148. Feb 17 20:36:42 gateway systemd[1]: Starting dhcpcd on all interfaces...
  149. Feb 17 20:36:42 gateway dhcpcd[775]: Not running dhcpcd because /etc/network/interfaces
  150. Feb 17 20:36:42 gateway dhcpcd[775]: defines some interfaces that will use a
  151. Feb 17 20:36:42 gateway dhcpcd[775]: DHCP client or static address
  152. Feb 17 20:36:42 gateway systemd[1]: dhcpcd.service: Control process exited, code=exited status=6
  153. Feb 17 20:36:42 gateway systemd[1]: Failed to start dhcpcd on all interfaces.
  154. Feb 17 20:36:42 gateway systemd[1]: dhcpcd.service: Unit entered failed state.
  155. Feb 17 20:36:42 gateway systemd[1]: dhcpcd.service: Failed with result 'exit-code'.
  156. Warning: dhcpcd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
  157. root@gateway:/home/pi#
  158. root@gateway:/home/pi# systemctl daemon-reload
  159. root@gateway:/home/pi# systemctl status dhcpcd
  160. ● dhcpcd.service - dhcpcd on all interfaces
  161. Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
  162. Drop-In: /etc/systemd/system/dhcpcd.service.d
  163. └─wait.conf
  164. Active: failed (Result: exit-code) since Sun 2019-02-17 20:36:42 GMT; 1min 23s ago
  165.  
  166. Feb 17 20:36:42 gateway systemd[1]: Starting dhcpcd on all interfaces...
  167. Feb 17 20:36:42 gateway dhcpcd[775]: Not running dhcpcd because /etc/network/interfaces
  168. Feb 17 20:36:42 gateway dhcpcd[775]: defines some interfaces that will use a
  169. Feb 17 20:36:42 gateway dhcpcd[775]: DHCP client or static address
  170. Feb 17 20:36:42 gateway systemd[1]: dhcpcd.service: Control process exited, code=exited status=6
  171. Feb 17 20:36:42 gateway systemd[1]: Failed to start dhcpcd on all interfaces.
  172. Feb 17 20:36:42 gateway systemd[1]: dhcpcd.service: Unit entered failed state.
  173. Feb 17 20:36:42 gateway systemd[1]: dhcpcd.service: Failed with result 'exit-code'.
  174. root@gateway:/home/pi#
  175.  
  176. pi@gateway:/etc$ cat os-release
  177. PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
  178. NAME="Raspbian GNU/Linux"
  179. VERSION_ID="9"
  180. VERSION="9 (stretch)"
  181. ID=raspbian
  182. ID_LIKE=debian
  183.  
  184. #auto eth0
  185. allow-hotplug eth0
  186. iface eth0 inet static
  187. address 192.168.2.1
  188. netmask 255.255.255.0
  189. network 192.168.2.0
  190. broadcast 192.168.2.255
Add Comment
Please, Sign In to add comment