Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

static ip

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
fredinator

static ip

#1 Post by fredinator »

how do i set up a static ip in debian. i have adsl with a router.

dnusinow
Debian Developer
Debian Developer
Posts: 75
Joined: 2005-12-12 16:35

#2 Post by dnusinow »

Set it up in /etc/network/interfaces. Read man interfaces for plenty of good docs and examples.
David Nusinow

sstone
Posts: 71
Joined: 2005-06-07 08:31

#3 Post by sstone »

i have like this:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
Must be enabled the dhcp server on the router and it's done.

Guest

#4 Post by Guest »

I think you can use the following settings in /etc/network/interfaces

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# Your static IP 
auto eth0
iface eth0 inet static
       address 192.168.79.29
       netmask 255.255.255.0
       network 192.168.79.0
       broadcast 192.168.79.255
       gateway 192.168.79.254



fredinator

#5 Post by fredinator »

how do i view my current settings (in dhcp) so i can set them the same

Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 483
Joined: 2004-04-06 18:19
Location: Utrecht, NL
Contact:

#6 Post by Jeroen »

A combination of ifconfig (seeing your current IP and broadcast address, and netmask) and route -n (seeing your gateway and your netmask). Post output of both over here if you need help with that.

Guest

#7 Post by Guest »

route -n

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
ifconfig

Code: Select all

eth0      Link encap:Ethernet  HWaddr 00:01:6C:B0:B6:67
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::201:6cff:feb0:b667/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3026 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2100 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4405603 (4.2 MiB)  TX bytes:146093 (142.6 KiB)
          Interrupt:217 Base address:0xe800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4740 (4.6 KiB)  TX bytes:4740 (4.6 KiB)

Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 483
Joined: 2004-04-06 18:19
Location: Utrecht, NL
Contact:

#8 Post by Jeroen »

So you're having address 192.168.1.2, netmask 255.255.255.0, broadcast 192.168.1.255, network 192.168.1.0, gateway 192.168.1.1

This is a local area network (LAN), that is not routeable from the internet, for example, this could be a small LAN as created by plugging systems into a typical broadband router -- via the gateway, you'll most likely have access to the internet using NAT.

Post Reply