Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #4013

Re: Fixed IP addreses on network.

From "Jonathan N. Little" <lws4art@gmail.com>
Newsgroups comp.os.linux.networking
Subject Re: Fixed IP addreses on network.
Date 2017-03-30 12:33 -0400
Organization LITTLE WORKS STUDIO
Message-ID <objbri$e95$1@dont-email.me> (permalink)
References <fcRCA.432076$Tb4.251145@fx03.fr7>

Show all headers | View raw


Doug Laidlaw wrote:
> I have bought a Raspberry Pi (amazing device) and
> added it to my home network.  I would like to give it
> a fixed IP address on the network.  I read somewhere
> about associating the Pi's MAC address with a fixed
> IP address, but my router does not seem to support
> doing that.  My desktop computer has a set IP
> address in its config, but the Pi runs Kodi, which is
> not an operating system, they tell me, so it can't
> set its own address.
>
> Any ideas please?

If you have Raspbian OS the default it is a Debian version of Linux. I 
have Ubuntu on mine, but the process is basically the same.

1) First discover the interface ID of your adapter. Legacy naming 
convention was eth0, eth1, wlan0, etc.; but with introduction of systemd 
the naming convention has changed. Example in a terminal window run 
command "ifconfig":

ifconfig

enxb827eb109bc0 Link encap:Ethernet  HWaddr b8:27:eb:10:9b:c0
           inet addr:192.168.1.5  Bcast:192.168.57.255  Mask:255.255.255.0
           inet6 addr: fe80::ba27:ebff:fe10:9bc0/64 Scope:Link
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:2619 errors:0 dropped:0 overruns:0 frame:0
           TX packets:1452 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:3675789 (3.6 MB)  TX bytes:135742 (135.7 KB)
...

"enxb827eb109bc0" is my Ethernet jack's identifier. Yours may be 
different. Just take note of it you will need it later.

2) Determine naming convention for interface partials for your OS with 
grep command. It can vary *.conf, *.cfg, ... depending on distro

grep source /etc/network/interfaces

source /etc/network/interfaces.d/*.cfg

3) Now make a static config file for your adapter. I'm going to call it 
"mystatic.cfg" because in the previous step the pattern was "*.cfg" and 
I will use the easy editor "nano":

sudo nano /etc/network/interfaces.d/mystatic.cfg

4) File content for this example with IP 192.168.1.2 with your router's 
IP 192.168.1.1, adjust accordingly:

# Set static IP for interface
auto enxb827eb109bc0
iface enxb827eb109bc0 inet static
address 192.168.1.2
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1

5) restart networking:

sudo systemctl restart networking.service

That should do it, your can check status with:

systemctl status networking.service

and confirm interface IP with

ifconfig

HTH

-- 
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Back to comp.os.linux.networking | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Fixed IP addreses on network. Doug  Laidlaw  <laidlaws@hotkey.net.au> - 2017-03-30 03:23 +1100
  Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-03-29 20:57 +0200
    Re: Fixed IP addreses on network. Doug Laidlaw <laidlaws@hotkey.net.au> - 2017-03-30 06:20 +1100
  Re: Fixed IP addreses on network. William Unruh <unruh@invalid.ca> - 2017-03-29 21:01 +0000
    Re: Fixed IP addreses on network. Doug Laidlaw <laidlaws@hotkey.net.au> - 2017-03-30 23:32 +1100
      Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-03-30 20:28 +0200
      Re: Fixed IP addreses on network. Gordon <Gordon@clear.net.nz> - 2017-03-31 05:23 +0000
  Re: Fixed IP addreses on network. robert.wolfe@wildcat.uuhec.net (Robert Wolfe) - 2017-03-30 13:27 +0000
  Re: Fixed IP addreses on network. robert.wolfe@wildcat.uuhec.net (Robert Wolfe) - 2017-03-30 13:28 +0000
    Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-03-30 20:34 +0200
      Re: Fixed IP addreses on network. Richard Kettlewell <invalid@invalid.invalid> - 2017-03-30 20:20 +0100
        Re: Fixed IP addreses on network. Gordon <Gordon@clear.net.nz> - 2017-03-31 05:44 +0000
      Re: Fixed IP addreses on network. "Jonathan N. Little" <lws4art@gmail.com> - 2017-03-30 16:56 -0400
        Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-03-31 00:18 +0200
          Re: Fixed IP addreses on network. "Jonathan N. Little" <lws4art@gmail.com> - 2017-03-30 18:52 -0400
            Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-03-31 19:38 +0200
  Re: Fixed IP addreses on network. ray carter <ray@zianet.com> - 2017-03-30 14:04 +0000
  Re: Fixed IP addreses on network. "Jonathan N. Little" <lws4art@gmail.com> - 2017-03-30 12:33 -0400
    Re: Fixed IP addreses on network. "Carlos E. R." <robin_listas@es.invalid> - 2017-03-31 01:59 +0200
      Re: Fixed IP addreses on network. "Jonathan N. Little" <lws4art@gmail.com> - 2017-03-30 23:10 -0400
        Re: Fixed IP addreses on network. Gordon <Gordon@clear.net.nz> - 2017-03-31 05:34 +0000
          Re: Fixed IP addreses on network. "Jonathan N. Little" <lws4art@gmail.com> - 2017-03-31 08:43 -0400
          Re: Fixed IP addreses on network. Jorgen Grahn <grahn+nntp@snipabacken.se> - 2017-03-31 14:10 +0000
            Re: Fixed IP addreses on network. "Jonathan N. Little" <lws4art@gmail.com> - 2017-03-31 11:02 -0400
            Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-03-31 19:45 +0200
        Re: Fixed IP addreses on network. "Carlos E. R." <robin_listas@es.invalid> - 2017-04-01 02:01 +0200
          Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-04-01 09:41 +0200
            Re: Fixed IP addreses on network. "Carlos E. R." <robin_listas@es.invalid> - 2017-04-01 12:50 +0200
              Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-04-02 00:17 +0200
                Re: Fixed IP addreses on network. "Carlos E. R." <robin_listas@es.invalid> - 2017-04-02 01:22 +0200
                Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-04-02 11:41 +0200
                Re: Fixed IP addreses on network. Jerry Peters <jerry@example.invalid> - 2017-04-02 20:00 +0000
                Re: Fixed IP addreses on network. Jerry Peters <jerry@example.invalid> - 2017-04-02 19:57 +0000
                Re: Fixed IP addreses on network. William Unruh <unruh@invalid.ca> - 2017-04-03 00:07 +0000
                Re: Fixed IP addreses on network. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-04-06 23:58 +0200
  Re: Fixed IP addreses on network. John Carter <me@mymailsvr.org> - 2017-03-31 04:51 +0000
  Re: Fixed IP addreses on network. Dave <noone$$@llondel.org> - 2017-04-02 14:39 -0700

csiph-web