Advertisement
Guest User

Untitled

a guest
Feb 4th, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. # sudo route -n
  2.  
  3. Kernel IP routing table
  4. Destination Gateway Genmask Flags Metric Ref Use Iface
  5. 0.0.0.0 192.168.8.1 0.0.0.0 UG 0 0 0 wlan0
  6. 0.0.0.0 192.168.8.1 0.0.0.0 UG 303 0 0 wlan0
  7. 169.254.0.0 0.0.0.0 255.255.0.0 U 202 0 0 eth0
  8. 192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
  9. 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
  10. 192.168.8.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
  11.  
  12. # sudo iptables -L
  13.  
  14. Chain INPUT (policy ACCEPT)
  15. target prot opt source destination
  16.  
  17. Chain FORWARD (policy ACCEPT)
  18. target prot opt source destination
  19. ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
  20. ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
  21.  
  22. Chain OUTPUT (policy ACCEPT)
  23. target prot opt source destination
  24.  
  25. # /etc/network/interfaces
  26.  
  27. # interfaces(5) file used by ifup(8) and ifdown(8)
  28.  
  29. # Please note that this file is written to be used with dhcpcd
  30. # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
  31.  
  32. # Include files from /etc/network/interfaces.d:
  33. source-directory /etc/network/interfaces.d
  34.  
  35. auto lo
  36. iface lo inet loopback
  37.  
  38. allow-hotplug wlan0
  39. iface wlan0 inet static
  40. address 192.168.8.254
  41. netmask 255.255.0.0
  42. gateway 192.168.8.1
  43. network 192.168.8.0
  44. broadcast 192.168.8.255
  45. metric 0
  46. post-up route add default gw 192.168.8.1 metric 0
  47. pre-down route del default gw 192.168.8.1
  48. wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  49.  
  50. allow-hotplug eth0
  51. iface eth0 inet static
  52. address 192.168.1.254
  53. gateway 192.168.8.254
  54. netmask 255.255.255.0
  55. network 192.168.1.0
  56. broadcast 192.168.1.255
  57. metric 1
  58. post-up route add default gw 192.168.8.254 metric 1
  59. pre-down route del default gw 192.168.8.254
  60.  
  61.  
  62. ------------
  63. Real router
  64. ------------
  65. Real router subnet = 192.168.8.0/24
  66. Pi ip on actual router (wlan0) = 192.168.8.254
  67.  
  68. ------------
  69. Pi router
  70. ------------
  71. Pi router subnet (eth0) 192.168.1.0/24 - forward traffic to 192.168.8.254 (wlan0)
  72. pi router ip (eth0) 192.168.1.254
  73. my pc 192.168.1.245
  74.  
  75. ---------------------------------------------------------------------------
  76.  
  77. from pi router - I can ping:
  78. google 8.8.8.8
  79. my pc 192.168.1.245
  80. actual router 192.168.8.1
  81.  
  82. from my pc - I can ping
  83. pi router 192.168.1.254
  84.  
  85. over actual router wifi, I can ping pi router aswel
  86. ------------------------------------------------------
  87.  
  88. Problem: Pi is not forwarding traffic between interfaces or simply forwarding traffic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement