Advertisement
Guest User

Untitled

a guest
Mar 30th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Start
  4. # Configure IP address for WLAN
  5. sudo ifconfig wlan0 192.168.0.1
  6. # Start DHCP/DNS server
  7. sudo service dnsmasq restart
  8. # Enable routing
  9. sudo sysctl net.ipv4.ip_forward=1
  10. # Enable NAT
  11. sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
  12. # Run access point daemon
  13. sudo hostapd /etc/hostapd/hostapd.conf
  14.  
  15. # Stop
  16. # Disable NAT
  17. sudo iptables -D POSTROUTING -t nat -o eth0 -j MASQUERADE
  18. # Disable routing
  19. sudo sysctl net.ipv4.ip_forward=0
  20. # Disable DHCP/DNS server
  21. sudo service dnsmasq stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement