LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-13-2009, 01:14 AM   #1
DavM
LQ Newbie
 
Registered: Oct 2009
Location: Sydney, Aust
Distribution: Ubuntu 9.10
Posts: 4

Rep: Reputation: 0
CentOS 5 Internet sharing and DHCP Help


Hey all. This is my first post, I know I'm a noob and I've been looking around at tutorials to help me in what I want to achieve. I'm looking to create a gateway and DHCP to share a Huawei E220 connection to a WAP so my girlfriend and I can both use the connection (will be replaced later in the year) I've gone through the tutorial at howtoforge and all it seems to do is assign IPs, and doesn't share the internet.
Also, if I restart the computer, the dhcpd service seems to switch off.

So I'm trying to share my internet on ttyUSB0(which is what the E220 shows up as) to eth0(I'm guessing this is the iptables bit) and assign IPs on the eth0 line (DHCP, which seems fine).

I think my main problem is iptables doesn't like my ttyUSB0 bit.

I'm running CentOS 5.3(I think I'll reinstall and start a fresh) on a P4.

So please help me. (even my Ipod gets a IP and it's usually the one that gives me trouble)

Also: when I connect eth0 to the switch, it seems to take over all connections and it stops the CentOS server from accessing the internet on ttyUSB0.

Last edited by DavM; 10-13-2009 at 01:40 AM. Reason: Added info
 
Old 10-13-2009, 09:17 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
DHCPD is not a service that starts by default. you have to set it with the chkconfig command to auto start, IE.

chkconfig --level 2345 dhcpd start

will set it to start by default in run levels 2, 3, 4 and 5 (your likely to be using either 3 or 5), this needs to be run as root, alternatively for an account with sudo

sudo /sbin/chkconfig --level 2345 dhcpd start

I am assuming you are sitting behind a router what is directly connected to the server via USB? if you then have an interface connected to a switch too, you have ensured the two interfaces are sitting on different subnets (else the server won't know what interface to use)? Also could you supply the information for the USB device in ifconfig possibly as well as the eth0 information.
 
Old 10-13-2009, 12:19 PM   #3
DavM
LQ Newbie
 
Registered: Oct 2009
Location: Sydney, Aust
Distribution: Ubuntu 9.10
Posts: 4

Original Poster
Rep: Reputation: 0
Ok thanks, I know I did the chkconfig but i'm unfamiliar with lvls, will try.
The USB Hauwei E220 is a Wireless Broadband Modem. So it plugs in and goes. and they're defiantly on different subsets. Not even the same ball park! Here's what the ttyUSB0 looks like in NM

Screenshot

I can easily start DHCPD service after sudo/root login but as soon as I plug eth0 in to allow me to start the service, ttyUSB0 takes a back seat and doesn't give me internet even when i don't have the service running. And then it looks like this

Screenshot 2

ttyUSB0 is still running but... isn't. eth0 automatically becomes the default.
 
Old 10-13-2009, 12:50 PM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Can you show the configuration of eth0 by chance? also while you are at it, the out put of "netstat -r" from the terminal before and after eth0 becomes live might help in figuring out the problem that is occuring.
 
Old 10-14-2009, 12:45 AM   #5
DavM
LQ Newbie
 
Registered: Oct 2009
Location: Sydney, Aust
Distribution: Ubuntu 9.10
Posts: 4

Original Poster
Rep: Reputation: 0
I've come to think this is impossible, seeing that in the "network configuration" gui, it doesn't show the ttyUSB0 (or ppp0 as I've found out and implemented, that lead me to have internet while connecting both interfaces but does something strange to the eth0, you'll see)

Screenshot of eth0

And the netstat:

Quote:
Destination Gateway Genmask Flags MSS Window irtt Iface
10.64.64.64 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 __tmp504566582
default 10.64.64.64 0.0.0.0 UG 0 0 0 ppp0
I think I'll give up and go to XP and just share the connection (unless there is a way). Remember that this isn't how it's going to end up. I'll eventually go for a little more of a sane idea

CLOUD===> wlan0-CentOS-eth0 ===>switch===>WAP===>Laptops

I was just using the E220 as a test(for a few months), but I think it's just not going to work.Supposed to look like this

CLOUD===> ppp0-CentOS-eth0 ===>switch===>WAP===>Laptops

I guess the news is that USB Wireless Broadband Modems aren't routable in Linux(at least the CentOS 5 distro).
 
Old 11-06-2009, 09:05 PM   #6
DavM
LQ Newbie
 
Registered: Oct 2009
Location: Sydney, Aust
Distribution: Ubuntu 9.10
Posts: 4

Original Poster
Rep: Reputation: 0
So I know this may be a month and a bit since the last post but I just wanted to tie it off. I found a solution, it's a little annoying each startup but here is is...
Changed OS to Ubuntu 9.10 (love it),
Plugin USB Modem
Change some settings (For Three(i.e. 3 Australia) change authentication to only CHAP and use PPP echo packets)
set iptables by going:
Quote:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
Then use "Dual DHCP DNS Server" at http://sourceforge.net/projects/dhcp-dns-server/
Easy install(follow instructions), Then run:
Quote:
/opt/dualserver/dualserver -v
Then it all works. "Dual DHCP DNS Server" even publishes a webpage that shows:
- Current Leases
- Available Dynamic Leases
- Available Static Leases

I also use vnstat with vnstat php frontend to view bandwidth

Thanks everyone
 
  


Reply

Tags
centos, centos5, dhcp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dhcp eth0 and XP eth1 internet sharing props666999 Slackware 8 08-20-2005 10:48 AM
Internet Sharing w/o DHCP Server Mookid77 Mandriva 1 07-20-2004 08:18 AM
Internet sharing and dhcp trouble iceaway Mandriva 2 03-12-2004 04:50 PM
Internet connection sharing and dhcp SolidSnake Linux - Networking 26 12-02-2003 11:23 AM
Sharing internet between DHCP protocol? tr4nce Linux - Networking 10 03-25-2003 07:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration