IP adress

JAPIB
2014-01-09
2014-01-14
  • JAPIB

    JAPIB - 2014-01-09

    Hello

    J begin to work with a Raspberry PI with CODESYS V3. It works very well.
    I use a DHCP server to bring an IP adress to my Raspberry. Is it possible to fix this adress, without the use of a DHCP server ?
    Maybe he should use linux commands, but I'm not an expert linux.
    Thank you in advance for your response

     
  • Anonymous - 2014-01-10

    Originally created by: M.Schaber

    Hi,

    Some DHCP servers (like current FritzBox models) allow to set a fixed IP address for a specific computer (MAC address). This way, you should be able to solve the problem without touching the Linux running on the Raspberry Pi. Another advantage is that the IP address also stays fixed when you boot a different image on the Pi.

    HTH,
    Markus

     
  • eschwellinger

    eschwellinger - 2014-01-10

    Hi,

    if you want to change this setting in the Pi the following steps are needed:

    1. you need on windows 'putty' (google it - this is a program which allow to login via ssh to the pi)

    2. Login with putty to the pi (you could find the current ip address in the plc logger in CODESYS)

    the login in for the Raspberry Pi
    pi
    raspberry

    (this is the default from the raspberry.org sd image)

    Then exeute:
    sudo nano /etc/network/Interfaces

    remove the line
    iface eth0 inet dhcp

    and add the following lines
    iface eth0 inet static
    address 192.168.xxx.xxx
    netmask 255.255.255.0
    gateway 192.168.xxx.1

    then Ctrl-o to save the changes, and ctrl-x to quit the Editor

    then

    sudo /etc/init.d/networking restart

    or simply reboot the pi
    sudo reboot

    That was it!

    Cheers Edwin

     
  • JAPIB

    JAPIB - 2014-01-14

    Thank you Edwin.
    It works well.
    But the command line seems to be case sensitive, if I write "sudo nano /etc/network/Interfaces", no file is found.
    If I write "sudo nano /etc/network/interfaces", the file is found, and I can modify it.
    I still have some things to learn with linux

    Thank you again

     
  • eschwellinger

    eschwellinger - 2014-01-14

    thanks you're right
    sudo nano /etc/network/interfaces
    is the right spelling...
    cu
    Edwin

     

Log in to post a comment.