Advertisement
TBotNik

Current Network Setting

Feb 29th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.08 KB | None | 0 0
  1. Gen'd by Script
  2.  
  3. Contents of the NetWork config file /etc/network/interfaces
  4.  
  5. # Local loopback
  6. auto lo
  7. iface lo inet loopback
  8.  
  9. # Primary internet connection (from Clear Box)
  10. auto eth2
  11. iface eth2 inet dhcp
  12.  
  13. # Secondary internet connection
  14. auto wlan0
  15. iface wlan0 inet dhcp
  16. wireless-essid abuelitos
  17. wireless-key abuelitos
  18. wireless-channel auto
  19. # wireless-mode managed
  20.  
  21.  
  22. # Secondary network connection (LAN)
  23. auto eth0
  24. iface eth0 inet static
  25. address 192.168.3.2
  26. netmask 255.255.255.0
  27. network 192.168.3.0
  28. broadcast 192.168.3.255
  29. gateway 192.168.3.1
  30.  
  31. # First Virtual Network
  32. auto eth0:80
  33. iface eth0:80 inet static
  34. address 10.10.40.2
  35. netmask 255.255.255.0
  36. network 10.10.40.0
  37. broadcast 10.10.40.255
  38. gateway 10.10.40.1
  39.  
  40. # Connect other NICS
  41. auto eth1
  42. iface eth1 inet static
  43. address 192.168.20.2
  44. netmask 255.255.255.0
  45. network 192.168.20.1
  46. broadcast 192.168.20.255
  47. gateway 192.168.20.1
  48.  
  49.  
  50. Contents of the DHCP config file /etc/dhcp3/dhcpd.conf
  51.  
  52. # Hold old values
  53. #default-lease-time 600;
  54. #max-lease-time 7200;
  55.  
  56. # Set new lease values
  57. default-lease-time 1200;
  58. max-lease-time 12000;
  59. option subnet-mask 255.255.255.0;
  60. option broadcast-address 192.168.3.255;
  61. option routers 192.168.3.2;
  62. option domain-name-servers 192.168.1.1, 204.232.137.207;
  63. option domain-name "tc-noc-server";
  64. log-facility local7;
  65. subnet 192.168.3.0 netmask 255.255.255.0 { range 192.168.3.10 192.168.3.200;}
  66.  
  67.  
  68. Contents of the sysctl.conf file /etc/sysctls.conf
  69.  
  70. #
  71. # /etc/sysctl.conf - Configuration file for setting system variables
  72. # See /etc/sysctl.d/ for additional system variables.
  73. # See sysctl.conf (5) for information.
  74. #
  75.  
  76. #kernel.domainname = example.com
  77.  
  78. # Uncomment the following to stop low-level messages on console
  79. #kernel.printk = 4 4 1 7
  80.  
  81. ##############################################################3
  82. # Functions previously found in netbase
  83. #
  84.  
  85. # Uncomment the next two lines to enable Spoof protection (reverse-path filter)
  86. # Turn on Source Address Verification in all interfaces to
  87. # prevent some spoofing attacks
  88. #net.ipv4.conf.default.rp_filter=1
  89. #net.ipv4.conf.all.rp_filter=1
  90.  
  91. # Uncomment the next line to enable TCP/IP SYN cookies
  92. #net.ipv4.tcp_syncookies=1
  93.  
  94. # Uncomment the next line to enable packet forwarding for IPv4
  95. #net.ipv4.ip_forward=1
  96.  
  97. # Uncomment the next line to enable packet forwarding for IPv6
  98. #net.ipv6.conf.all.forwarding=1
  99.  
  100.  
  101. ###################################################################
  102. # Additional settings - these settings can improve the network
  103. # security of the host and prevent against some network attacks
  104. # including spoofing attacks and man in the middle attacks through
  105. # redirection. Some network environments, however, require that these
  106. # settings are disabled so review and enable them as needed.
  107. #
  108. # Ignore ICMP broadcasts
  109. #net.ipv4.icmp_echo_ignore_broadcasts = 1
  110. #
  111. # Ignore bogus ICMP errors
  112. #net.ipv4.icmp_ignore_bogus_error_responses = 1
  113. #
  114. # Do not accept ICMP redirects (prevent MITM attacks)
  115. #net.ipv4.conf.all.accept_redirects = 0
  116. #net.ipv6.conf.all.accept_redirects = 0
  117. # _or_
  118. # Accept ICMP redirects only for gateways listed in our default
  119. # gateway list (enabled by default)
  120. # net.ipv4.conf.all.secure_redirects = 1
  121. #
  122. # Do not send ICMP redirects (we are not a router)
  123. #net.ipv4.conf.all.send_redirects = 0
  124. #
  125. # Do not accept IP source route packets (we are not a router)
  126. #net.ipv4.conf.all.accept_source_route = 0
  127. #net.ipv6.conf.all.accept_source_route = 0
  128. #
  129. # Log Martian Packets
  130. #net.ipv4.conf.all.log_martians = 1
  131.  
  132. #disable ipv6
  133. net.ipv6.conf.all.disable_ipv6 = 1
  134. net.ipv6.conf.default.disable_ipv6 = 1
  135. net.ipv6.conf.lo.disable_ipv6 = 1
  136.  
  137. # enable forwarding
  138. net.ipv4.conf.default.forwarding=1
  139. net.ipv4.conf.all.forwarding=1
  140. net.ipv4.ip_forward=1
  141.  
  142.  
  143. Contents of the resolv.conf file /etc/resolv.conf
  144.  
  145. nameserver 192.168.15.1
  146.  
  147. Contents of the hostname file /etc/hostname
  148.  
  149. tc-noc-server
  150.  
  151. Contents of the iptables file /etc/iptables
  152.  
  153.  
  154. Snap shot of the network settings from ifconfig
  155.  
  156. eth0 Link encap:Ethernet HWaddr 00:0c:f1:ac:5a:7b
  157. inet addr:192.168.3.2 Bcast:192.168.3.255 Mask:255.255.255.0
  158. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  159. RX packets:6407 errors:0 dropped:0 overruns:0 frame:0
  160. TX packets:6134 errors:0 dropped:0 overruns:0 carrier:0
  161. collisions:3 txqueuelen:1000
  162. RX bytes:3485623 (3.4 MB) TX bytes:1452534 (1.4 MB)
  163.  
  164. eth0:80 Link encap:Ethernet HWaddr 00:0c:f1:ac:5a:7b
  165. inet addr:10.10.40.2 Bcast:10.10.40.255 Mask:255.255.255.0
  166. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  167.  
  168. eth1 Link encap:Ethernet HWaddr 00:10:5a:12:c0:ff
  169. inet addr:192.168.20.2 Bcast:192.168.20.255 Mask:255.255.255.0
  170. UP BROADCAST MULTICAST MTU:1500 Metric:1
  171. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  172. TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  173. collisions:0 txqueuelen:1000
  174. RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
  175. Interrupt:17 Base address:0x2800
  176.  
  177. eth2 Link encap:Ethernet HWaddr 00:10:5a:82:9a:cd
  178. inet addr:192.168.15.4 Bcast:192.168.15.255 Mask:255.255.255.0
  179. UP BROADCAST RUNNING MULTICAST MTU:1400 Metric:1
  180. RX packets:884 errors:0 dropped:0 overruns:0 frame:0
  181. TX packets:2781 errors:0 dropped:0 overruns:0 carrier:0
  182. collisions:0 txqueuelen:1000
  183. RX bytes:234887 (234.8 KB) TX bytes:289323 (289.3 KB)
  184. Interrupt:18 Base address:0x4400
  185.  
  186. lo Link encap:Local Loopback
  187. inet addr:127.0.0.1 Mask:255.0.0.0
  188. UP LOOPBACK RUNNING MTU:16436 Metric:1
  189. RX packets:1389 errors:0 dropped:0 overruns:0 frame:0
  190. TX packets:1389 errors:0 dropped:0 overruns:0 carrier:0
  191. collisions:0 txqueuelen:0
  192. RX bytes:206557 (206.5 KB) TX bytes:206557 (206.5 KB)
  193.  
  194. wlan0 Link encap:Ethernet HWaddr 00:0f:3d:ad:c3:c8
  195. inet addr:192.168.1.4 Bcast:192.168.1.255 Mask:255.255.255.0
  196. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  197. RX packets:19831 errors:0 dropped:0 overruns:0 frame:0
  198. TX packets:21965 errors:0 dropped:0 overruns:0 carrier:0
  199. collisions:0 txqueuelen:1000
  200. RX bytes:13554936 (13.5 MB) TX bytes:7317457 (7.3 MB)
  201.  
  202. WiFi/Networking Start/Restart Script
  203. #! /bin/bash
  204.  
  205. # Files needed for networking are:
  206. # /etc/network/interfaces
  207. # /etc/iptables
  208. # /etc/resolv.conf
  209. # /etc/sysctl.conf
  210. #
  211.  
  212. # Find current wlan0 channel with
  213. # iwlist ath0 channel;
  214.  
  215. # Run the commands to start network passthru
  216. /etc/init.d/dhcp3-server restart;
  217. /etc/init.d/networking restart;
  218. # If Network Manager Icon shows on status bar run next line, else comment out
  219. restart network-manager;
  220. /etc/init.d/dhcp3-server restart;
  221.  
  222. # Additional commands
  223. sysctl -w net.ipv4.ip_forward=1;
  224. iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE;
  225. iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE;
  226.  
  227. # Finish
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement