Guest User

Untitled

a guest
Jun 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. ```
  2. # Edit /etc/NetworkManager/NetworkManager.conf adding the following
  3. # to make network manager stop managing your ethernet interface
  4. [keyfile]
  5. unmanaged-devices=mac:3c:90:01:39:b2:62;
  6. # Use the MAC address from your ethernet card
  7. # You can get the MAC address with the command:
  8. ip link show dev eth0
  9. # (assuming your ethernet device is called eth0)
  10.  
  11. # restart network-manager to pick up the changes
  12. sudo service network-manager restart
  13.  
  14. # Install dnsmasq
  15. sudo apt install dnsmasq
  16.  
  17. # Add the following line to /etc/dnsmasq.conf
  18. dhcp-range=172.23.0.50,172.23.0.200,12h
  19.  
  20. # Run the following to turn you computer into a gateway
  21. # (replace eth0 with your ethernet interface name)
  22. # (replace wlan0 with your wifi interface name)
  23.  
  24. ifconfig eth0 172.23.0.1 netmask 255.255.255.0 up
  25. echo "1" > /proc/sys/net/ipv4/ip_forward
  26. iptables -P FORWARD ACCEPT
  27. iptables -t nat -F POSTROUTING
  28. iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
  29. /etc/init.d/dnsmasq restart
  30.  
  31. # Connect another computer to your ethernet port and it should get an IP using DHCP and have internet access
  32. ```
Add Comment
Please, Sign In to add comment