LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-31-2005, 10:07 PM   #1
bd1308
LQ Newbie
 
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29

Rep: Reputation: 15
manually specifying IP address


okay, I remembered looking at a /etc/interfaces file to specify a IP address manually....using subnet, router stuff, etc...

what syntax/entries do i need for this to work?



b
 
Old 08-31-2005, 10:12 PM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Re: manually specifying IP address

Quote:
Originally posted by bd1308
okay, I remembered looking at a /etc/interfaces file to specify a IP address manually....using subnet, router stuff, etc...

what syntax/entries do i need for this to work?



b
Code:
>$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 24.222.0.66 24.222.0.91
The dns-nameservers is not necessary unless you have the resolvconf package installed if you do not then you need to put your nameservers in the file /etc/resolv.conf like this.

Code:
>$ cat /etc/resolv.conf
nameserver 24.222.0.66
nameserver 24.222.0.91
Then use /etc/init.d/networking restart to restart networking with the new settings.
 
Old 08-31-2005, 10:13 PM   #3
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
from my /etc/network/interfaces (notice the bold, you aren't at the right place) :

Code:
iface eth4 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
 
Old 08-31-2005, 10:18 PM   #4
bd1308
LQ Newbie
 
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29

Original Poster
Rep: Reputation: 15
okay thanks!


network!!
makes sense now


 
Old 08-31-2005, 10:27 PM   #5
bd1308
LQ Newbie
 
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29

Original Poster
Rep: Reputation: 15
did it and it worked! thanks people!

Last edited by bd1308; 08-31-2005 at 10:45 PM.
 
  


Reply



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 to find an IP address from the MAC address of a remote machine ? jitz Linux - General 3 01-03-2006 07:55 AM
dhcp no ip address and netmask dont match route address pengy666 Linux - Wireless Networking 1 05-08-2005 09:33 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
Should i use the eth0 ip address of my internet ip address when applying iptables ForumKid Linux - Security 2 01-03-2002 08:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:41 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