Internet Connection Sharing: Difference between revisions

imported>Onny
mNo edit summary
imported>Onny
mNo edit summary
Line 44: Line 44:


# Start dnsmasq for DHCP
# Start dnsmasq for DHCP
dnsmasq -d -i eth0 -F $client,$client,1m -O option:dns-server,1.1.1.1,1.0.0.1 &
dnsmasq -d -i eth0 --dhcp-range=10.0.0.2,10.0.0.255,255.255.255.0,24h
</syntaxhighlight>
</syntaxhighlight>


To cleanup the configured interface run following commands
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# Cleanup
ip addr del 10.0.0.1/24 dev eth0
ip addr del $host dev $link
ip link set down eth0
ip link set down $link
iptables -t nat -D POSTROUTING -o wlan0 -j MASQUERADE
iptables -t nat -D POSTROUTING -o $wanlink -j MASQUERADE
iptables -D DOCKER-USER -i $link -j ACCEPT
iptables -D DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
</syntaxhighlight>
</syntaxhighlight>


[[Category:Networking]]
[[Category:Networking]]