LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-16-2005, 05:01 AM   #1
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
Zoom modem/switch & linux<->linux network: DHCP / Static ?


Hello,
I am going round in circles here, and would appreciate some help....

Hard/soft-ware:
Zoom X5 ADSL Modem/Firewall/5-port Switch (such a lovely piece of kit, I'd swear it's running linux!) connected to eth0 on each of 2 pc's running MDK 9.1 and 10.1 OE.

When I boot, it says "Bringing up eth0....FAILED. But I think that's just a Mandrake thing and it doesn't seem to matter. I connect to the internet at boot time by putting these commands at the end of /etc/rc.d/rc.local:

ifdown eth0
dhclient eth0


Both machines happily access the internet.

Each machine is assigned a network address like 10.0.0.4 and 10.0.0.5 by the Zoom. These numbers change as they are assigned by the Zoom's DHCP server, and cannot be relied on to stay the same.

/etc/resolv.conf just says nameserver 10.0.0.2
/etc/hosts just has 127.0.0.1 localhost
hostname returns localhost for both computers

If I go to the other computer, and find out what its address is, I can ping it as ping 10.0.0.4

I would like to set up my network so that I can move files between both machines and I am not sure how to do this: everybody else seems to be using samba (for windows shares), and it seems I need nfs.

The nfs HOWTOs assume that my machines have a static IP, which they don't, or that I am running a dhcp server (which I am not - as I understand it, the Zoom is my dhcp server and is in turn presumably a client for my ISP's dhcp server).

I have a web interface to the zoom (http://10.0.0.2), but it is very difficult to understand and windows-centric.
Here is a link to it's manual:

http://zoom.com/documentation/adsl/5...al_EngRevB.pdf

How can I-

EITHER give my two linux machines static IP addresses eg 192.168.1.1 and 192.168.1.2 and still have them connect to the internet?

OR, better, fix it so I can refer to each machine by name? (hostname, netmask, broadcast, route, ifconfig, bang, head, against, wall).

Thanks
 
Old 01-16-2005, 12:23 PM   #2
dyw
Member
 
Registered: Nov 2004
Posts: 65

Rep: Reputation: 15
I have the Zoom X4, and also love it. What you need to do is stop using its built-in DHCP server. Just assign each a private IP address. The Zoom X5 will not mind. Just make sure each one is a unique IP address. Use whatever network configuration utility you like to change it.

Then you may need to do whatever its equivalent to 'release and renew' is, to discard its old DHCP assigned address and use its new static one.

Note that it is your LAN IP address that now becomes static - all your machines and the Zoom X5 all share a single WLAN (Internet) IP address that may or may not change depending on your ISP and your service plan.

After that, if you'd like to refer by name, the simplest thing is to edit the hosts file.
 
Old 01-16-2005, 12:32 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Original Poster
Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
Well, perseverance, poking-about and head-scratching seems to have paid off at last.

I found this really simple guide to networking:

http://web.onetel.net.uk/~showerail/...net_setup.html (Thanks Chris!)

Much of this is lifted from that. Anyway, this is what I did:

Edited out the bits in /etc/rc.d/rc.local that I used to use to connect to the Zoom. If you haven't made a kludge like this then you won't have to undo it!

Bring the current connection down:
ifdown eth0

Chris says Edit /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.2 # or whatever your IP address is to be - see above
NETMASK=255.255.255.0 # or 255.0.0.0 if your IP address is 10.x.x.x
NETWORK=192.168.1.0 # or 10.0.0.0 if your IP address is 10.x.x.x or 192.168.2.0 if your IP address is 192.168.2.x
BROADCAST=192.168.1.255 # or 10.255.255.255 if your IP address is 10.x.x.x or 192.168.2.255 if your IP address is 192.168.2.x
ONBOOT=yes
MII_NOT_SUPPORTED=yes


So I set it like this:
Code:
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.0.0.6            #192.168.1.2 or whatever your IP address is to be - see above
NETMASK=255.0.0.0          #255.255.255.0 or 255.0.0.0 if your IP address is 10.x.x.x
NETWORK=10.0.0.0           #192.168.1.0 or 10.0.0.0 if your IP address is 10.x.x.x or 192.168.2.0 if your IP address is 192.168.2.x
BROADCAST=10.255.255.255   #192.168.1.255 or 10.255.255.255 if your IP address is 10.x.x.x or 192.168.2.255 if your IP address is 192.168.2.x
ONBOOT=yes
MII_NOT_SUPPORTED=yes
Note, I initally tried setting the IPADDR to 10.0.0.32, which is outside the range that the Zoom's dhcp server serves up by default, because I did not want the dhcp server to serve up an address that I had already allocated if I plugged in yet another computer at some time. But that meant that I could ping the p4 (10.0.0.12) and http://10.0.0.2 (The zoom) but trying to access google gave "The connection to www.google.com was refused". Setting the IPADDR to (static) 10.0.0.6 didn't cause this problem. Maybe it's something to do with the Zoom's firewall? So I have turned off the Zoom's dhcp server (http://10.0.0.2, Advanced Setup, Disable DHCP Server, Save Settings, Reboot the Zoom). It seemed the easiest thing to do.

Chris says /etc/resolv.conf should contain the nameserver address(es) - put the address of your ISPs nameserver right at the top. eg:
nameserver 195.20.224.165


So I put nameserver 10.0.0.2 in resolv.conf, as 10.0.0.2 is the address of the Zoom.

The default gateway and your hostname go in /etc/sysconfig/network:

HOSTNAME=yourhostname_goes_here
NETWORKING=yes
GATEWAY=192.168.1.1 # or the IP address of your gateway device - your default gateway
GATEWAYDEV=eth0


So I put

Code:
HOSTNAME=p3.home.net
NETWORKING=yes
GATEWAY=10.0.0.2
GATEWAYDEV=eth0
I just made up the name p3.home.net, it doesn't seem to matter as it's MY network. 10.0.0.2 is the address of the Zoom, and it is plugged into eth0.

But the command hostname still returned localhost. So I said, as root:

hostname p3.home.net

The address of the other PC is 10.0.0.12, so I added a line to /etc/hosts that says:
10.0.0.12 p4.home.net p4

Now I can ping p4 from p3, and once I had fixed up p4.home.net likewise, do the reverse. Best of all, this all survives a reboot.

Hope this helps someone else.
 
Old 01-16-2005, 12:34 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Original Poster
Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
Thanks dyw - you beat my reply by 9mins!
 
Old 01-16-2005, 09:31 PM   #5
dyw
Member
 
Registered: Nov 2004
Posts: 65

Rep: Reputation: 15
You're welcome - glad to be of help. Help some, be helped some...
 
Old 11-08-2007, 11:24 PM   #6
reakinator
Member
 
Registered: Oct 2005
Location: California
Distribution: Ubuntu Feisty
Posts: 52

Rep: Reputation: 15
is this possible to do and still have dhcp?

I know this post is old, but I need to do something very similar, with the same zoom x5 adsl router:

I'm attempting to set up a file/web server at an office that needs dhcp for visiting clients. It is apparent that the server (which is on a linux machine running Ubuntu Server 7.10) needs a static IP. To do this, the above instructions explain the dhcp serving has to be turned off in the zoom x5. However, then all the computers in the office need to be assigned IP's statically, which is where the problem is.

Does anyone know a way to give the server a static IP, where it can use ssh, LAMP, and ftp, and still provide dhcp for the other computers within the office?

thanks in advance,
rich
 
Old 11-09-2007, 01:14 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Original Poster
Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
Ubuntu is debian-based, and does things differently.
To give the server a static IP edit the file /etc/network/interfaces
Find the bit that refers to eth0 and make it look like this:
Code:
 
auto eth0
iface eth0 inet static
broadcast 10.255.255.255
address 10.0.0.8
netmask 255.255.255.0
gateway 10.0.0.2
# These settings might be for a small 192.168.0.x network
# broadcast 192.168.0.255
# address 192.168.0.8
# netmask 255.255.255.0
# gateway 192.168.0.1
In both cases the gateway address is the address of the zoom

In /etc/resolv.conf you need the address of the zoom:
nameserver 10.0.0.2
(assuming the zoom is at 10.0.0.2)

Then restart the interface (as root)
ifdown eth0
ifup eth0


You can leave the zoom serving up dhcp for other computers if you like, but I have found life easier if they all have static IPs. If you do this, make sure all the PCs /etc/hosts files are referring to the other PCs static addresses:
Code:
cat /etc/hosts
# You must have this line: it's the loopback interface
127.0.0.1  localhost
# List all the pcs here, with their static IPs
10.0.0.3   p3.home.net     p3
10.0.0.4   p4.home.net     p4
10.0.0.8   server.home.net server
10.0.0.20  rio.home.net    rio
10.0.0.21  samson.home.net samson
10.0.0.30  red.home.net    red

Last edited by tredegar; 11-11-2007 at 03:39 AM. Reason: Bad paste
 
Old 11-10-2007, 11:22 PM   #8
reakinator
Member
 
Registered: Oct 2005
Location: California
Distribution: Ubuntu Feisty
Posts: 52

Rep: Reputation: 15
Okay, looks to be a little simpler than I thought. I also have another question pertaining to the zoom x5. I need to open up port 22, but I haven't been able to do so yet. Here are the settings I have under the 'ip filtering' button:

RuleID I/F Apply Stateful Inspection Direction Rule Action
22 ALL Disable Incoming Accept N/A

In I/F Log Option Oper. Status
N/A Disable - Up

Does any of this look troublesome, or do I need to change some other settings?

thanks for helping me figure this out,
rich
 
Old 11-11-2007, 03:41 AM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Original Poster
Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
Quote:
I need to open up port 22, but I haven't been able to do so yet.
I no longer have that modem/router, so you'll have to read the manual to work out port forwarding.
You need to accept connections to port 22 on your router, and forward them to the LAN IP number of your PC, port 22.
 
  


Reply


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
How Do I Switch From Static IP To DHCP Psibur Linux - Networking 3 06-23-2005 09:40 AM
Switch DHCP to STATIC zaicheke Linux - Newbie 2 09-14-2004 09:12 PM
Switch DHCP to static Darkangel90 Linux - Networking 1 03-29-2004 05:15 AM
switch RH 7.2 from DHCP over to static IP dwichman Linux - Networking 3 03-04-2002 01:28 AM
Switch from static IP to dhcp ? Fuel Linux - Networking 2 02-23-2002 09:21 PM


All times are GMT -5. The time now is 09:35 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration