-
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

5 Port Gigabit Unmanaged Ethernet Switch, Home Network Hub, Office Ethernet S...
$9.64

NETGEAR GS308EP Essential Series 8-Port Gigabit PoE+ Unmanaged Switch
$49.99

D-Link DGS-1210-28P 28-Port PoE Gigabit Web Smart Switch With Cord
$49.99

TP-Link TL-SG1048 48-Port Gigabit Rackmount Switch New Factory Sealed
$199.99

TP-Link TL-SG105 5-Port Gigabit Ethernet Unmanaged Metal Desktop Network Switch
$19.99

10-Port Gigabit PoE Network Switch with 8 PoE+ Ports with 2 Combo SFP Slots 125W
$39.99

TP-Link TL-SG105, 5 Port Gigabit Unmanaged Ethernet Switch, Network Hub, Ethern
$15.25

Arista DCS-7010T-48-R 48P 1GbE 4P 10GbE SFP+ RA Switch with rack mounts
$69.00

Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch
$129.99

Cisco Catalyst 2960-48TT-L 48-Port Fast Ethernet Managed Rackmount Switch
$46.99