homey
06-02-2003, 10:53 AM
My favorite is a quick and easy GUI tool for setting up the masquerading such as http://firestarter.sourceforge.net/
You can edit the iptables or you can use a script to set up Masquerading. This site has a wonderful collection of scripts. http://www.linuxguruz.com/iptables/
1. Setup the local network
Eth0 gets an IP address from your ISP
edit: if you are connected to the Internet by a modem then you won't need two nics. The modem will probably be called ppp0.
and the nic connected to your other computers may be called Eth0.
Eth1 gets a static IP address ( 192.168.0.1 ) and is connected to the local network.
Your Linux computer acts as the dhcp server for the client computers.
All of the computers are connected through a hub or switch.
The client computers are set to obtain address automatically.
2. Edit the files /etc/dhcpd.conf and /etc/resolv.conf
3. Start the named and dhcpd services
4. Install firestarter and make sure the firestarter service is started.
5. Start the client computer and start surfing. :)
Examples...
/etc/dhcpd.conf
ddns-update-style ad-hoc;
option domain-name "workgroup";
default-lease-time 604800;
max-lease-time 604800;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.50;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
}
Note: you can use your ISP name servers instead of 192.168.0.1 . That way, you won’t need to start the named service on your computer.
/etc/resolv.conf
; generated by /sbin/dhclient-script
search YOURISP.com
nameserver YOUR ISP IP ADDRESS #1
nameserver YOUR ISP IP ADDRESS #2
nameserver YOUR ISP IP ADDRESS #3
nameserver 127.0.0.1
Check / edit the file /etc/named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
include "/etc/rndc.key";
You can edit the iptables or you can use a script to set up Masquerading. This site has a wonderful collection of scripts. http://www.linuxguruz.com/iptables/
1. Setup the local network
Eth0 gets an IP address from your ISP
edit: if you are connected to the Internet by a modem then you won't need two nics. The modem will probably be called ppp0.
and the nic connected to your other computers may be called Eth0.
Eth1 gets a static IP address ( 192.168.0.1 ) and is connected to the local network.
Your Linux computer acts as the dhcp server for the client computers.
All of the computers are connected through a hub or switch.
The client computers are set to obtain address automatically.
2. Edit the files /etc/dhcpd.conf and /etc/resolv.conf
3. Start the named and dhcpd services
4. Install firestarter and make sure the firestarter service is started.
5. Start the client computer and start surfing. :)
Examples...
/etc/dhcpd.conf
ddns-update-style ad-hoc;
option domain-name "workgroup";
default-lease-time 604800;
max-lease-time 604800;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.50;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
}
Note: you can use your ISP name servers instead of 192.168.0.1 . That way, you won’t need to start the named service on your computer.
/etc/resolv.conf
; generated by /sbin/dhclient-script
search YOURISP.com
nameserver YOUR ISP IP ADDRESS #1
nameserver YOUR ISP IP ADDRESS #2
nameserver YOUR ISP IP ADDRESS #3
nameserver 127.0.0.1
Check / edit the file /etc/named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
include "/etc/rndc.key";