-
Junior Member
registered user
It is working: I am able to share the internet connection I establish with my Linux box. And here is how I did it:
My Linux box is equipped and setup as follows:
ippp1 – ISDN interface to receive DHCP from my Service Provider
wlan0 – Wireless network card for my internal network, manually assigned IP 192.168.0.1 (see step 2)
Step 1
Install DHCP and edit dhcpd.conf as follows
#dhcpd.conf
#
ddns-update-style ad-hoc;
default-lease-time 1800;
max-lease-time 72000;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1; # IP of wlan0 / internal network
option domain-name-servers <IP DNS 1>, <IP DNS 2>; #Check with your ISP
option domain-name “<name of your Linux box” How you named your Linux box during setup
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.02 192.168.0.10;
}
Step 2
Edit /etc/network/interfaces file as follows
#interfaces
#
auto wlan0
iface wlan0 inet static
address 192.168.0.1
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
Step 3
Restart Your Network by issuing the following command from a shell:
/etc/init.d/networking restart
Step 4
- Set your client machines to receive DHCP from this server
- Ping your Linux box / Server from your client to ensure everything is okay
Step 5
Create Firewall Scrip rc.firewall in order to allow packet forwarding
1. touch /etc/init.d/rc.firewall #creates rc.firewall script
2. edit rc.firewall as follows:
#!/bin/bash
/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t mangle -F
/sbin/iptables -X
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -m state --state NEW -i ! ippp1 -j ACCEPT
# only if both of the above rules succeed, use
/sbin/iptables -P INPUT DROP
/sbin/iptables -A FORWARD -i ippp1 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -i wlan0 -o ippp1 -j ACCEPT
echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o ippp1 -j MASQUERADE
/sbin/iptables -A FORWARD -i ippp1 -o ippp1 -j REJECT
Step 6
Make rc.firewall script executable:
chmod +x /etc/init.d/rc.firewall
Step 7
Run rc.firewall script:
/etc/init.d/rc.firewall
Your server/router box should now be able to route internet traffic from and to your LAN throu your shared ISDN internet connection.
Action items:
- Create your own firewall script to suit your own needs, in case the one provided here is not sufficient
- Set rc.firewall to run at boot time so you do not have to start the script manually every time you (re-)boot (e.g. as described here)
- Automatically establish an internet connection if a client tries to access the internet
- Make ibod (bandwidth on demand) work with this solution
Credits
This solution has been developed by canjfn and I found it here.
Enjoy.
Torbu
BTW: If anybody here knows how to automatically establish an internet connection from the Linux box, every time a client tries to access the internet, please feel free to post it here!
Similar Threads
-
By ralfS in forum Networking
Replies: 0
Last Post: 08-12-2005, 02:55 PM
-
By lfs in forum Customising & Remastering
Replies: 3
Last Post: 08-09-2005, 03:58 AM
-
By dubayou in forum General Support
Replies: 0
Last Post: 06-16-2004, 03:53 AM
-
By Webster in forum Customising & Remastering
Replies: 1
Last Post: 05-27-2004, 03:23 PM
-
By beforewisdom in forum General Support
Replies: 3
Last Post: 04-19-2003, 02:54 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Vintage Cubix A2870 + 2x A2310 QL 2286 Video Module ISA Boards 1989 Untested
$207.92

Vintage HP 21MX 1000 M-Series Minicomputer Chassis Backplane Parts AS-IS
$325.99

Vintage Computer Keyboard Northgate OMNIKEY Ultra
$120.00

Lot of 2 Vintage Plextor PX-43CS SCSI CD-ROM Caddy Drives + 4 Caddies Used
$55.99

Original Vintage Old Style STANDARD Black CD Jewel Case (Heavy Duty) 90g Lot
$316.95

VINTAGE AOPEN MODEL SPI-200 200W AT POWER SUPPLY WITH SWITCH DS-PS-8
$34.95

VINTAGE ESS ES1868 16 BIT ISA SOUND CARD COMPAQ 247428-001 - USA SELLER RM2-SC
$24.95

Vintage Emagic Logic 5 / Logic Audio 4.0 Studio Software Box Manuals Serial
$89.99

Vintage Apple iMac G4 15" Lamp 700MHz 512MB Mac OS X 10.4.6 W/ Pro Speakers
$300.00

Vintage Promise EIDEMAX Enhanced IDE Disk Controller ISA Non-RAID Card Boxed
$34.99