2

I have openSUSE 13.2. My laptop connects to the internet through a WiFi network but I have an embedded device which I need to connect to it through the ethernet interface. It has an IP address of 192.168.2.50. The problem is I set the IP address of the interface using this:

ifconfig enp3s0 192.168.2.64 netmask 255.255.255.0

This works fine but when the device disconnects or reboot, the connection I made is lost and the PC attempts to connect through the ethernet interface and my internet connection is lost. I have to unplug the cable, apply the command and reconnect the cable to connect to my device while not interrupting the internet connection. So is is possible to set a permanent IP so it should not interfere with other interfaces and connections ?

1
  • Are you using ifup or NetworkManager? You can check that in YaST -> Network Settings
    – myaut
    Commented Apr 21, 2015 at 13:05

2 Answers 2

1

If it's connected to the router, many routers allow a permanent address to be assigned to a device based on its MAC address. Addresses will still be assigned by DHCP but the router will always give the device with that MAC address the IP address you specify.

1
  • It is not connected to a router. Direct connection to my PC
    – 3bdalla
    Commented Apr 12, 2015 at 11:25
0

commands which you have to fire are : 1. Check your NIC

ifconfig

  1. Choose one and set it with ip which you want to give

    ifconfig enp0s8 192.168.1.34

  2. go to

    cd /etc/sysconfig/network-scripts/

  3. edit NIC file

    vim ifcfg-enp0s8

    do -->

'IPADDR' = 192.168.1.34 'NETMASK'= 255.255.255.0 'ONBOOT' = yes 'BOOTPROTO'= 'static' 5. done

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .