Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ubuntu/Debian Setup to make device eth0 dhcp server, and translate internet connection from wlan0
- always as ROOT!!!!!!
- # vim /etc/default/dhcp3-server
- and set
- INTERFACES="eth0"
- # vim /etc/network/interfaces
- and add
- auto eth0
- iface eth0 inet static
- address 10.1.1.254
- netmask 255.255.255.0
- broadcast 10.1.1.255
- network 10.1.1.0
- run
- # /etc/init.d/networking restart
- # vim /etc/dhcp3/dhcpd.conf
- and set only
- default-lease-time 600;
- max-lease-time 7200;
- option domain-name-servers 208.67.222.222, 208.67.220.220;
- subnet 10.1.1.0 netmask 255.255.255.0 {
- range 10.1.1.10 10.1.1.20;
- option routers 10.1.1.254;
- option broadcast-address 10.1.1.255;
- }
- run
- # /etc/init.d/dhcp3-server restart
- if e.g. wlan0 is connected to the net, to translate internet connection to any dhcp client connected to eth0 (directly or through a switch), must be executed this script (modify accordingly)
- -- script start --
- #!/bin/bash
- echo 1 > /proc/sys/net/ipv4/ip_forward
- WAN="wlan0"
- LAN="eth0"
- /sbin/iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
- /sbin/iptables -A FORWARD -i $WAN -o $LAN -m state --state RELATED,ESTABLISHED -j ACCEPT
- /sbin/iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
- -- script end --
- if things don't work following the steps, reboot client and server and rerun the script on server
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement