Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all, Fedora 17 desktop 64bit I have 2 NICs on the PC, a PCIe NIC card and an onboard NIC. The PC is now connecting the router via PCIe ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,792

    About setup static IP


    Hi all,

    Fedora 17 desktop 64bit

    I have 2 NICs on the PC, a PCIe NIC card and an onboard NIC. The PC is now connecting the router via PCIe card and running dynamic IP.

    # ifconfig
    Code:
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.0.10  netmask 255.255.255.0  broadcast 192.168.0.255
            inet6 fe80::92f6:52ff:fe03:5786  prefixlen 64  scopeid 0x20<link>
            ether 90:f6:52:03:57:86  txqueuelen 1000  (Ethernet)
            RX packets 8471  bytes 6826859 (6.5 MiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 8620  bytes 1295445 (1.2 MiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            ether 00:0e:a6:f9:a3:5b  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 0  (Local Loopback)
            RX packets 1616  bytes 464962 (454.0 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 1616  bytes 464962 (454.0 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    # cat /etc/sysconfig/network-scripts/ifcfg-eth0
    Code:
    UUID="c29af442-1fb3-44dc-a15a-0159397bbacd"
    NM_CONTROLLED="yes"
    HWADDR="90:F6:52:03:57:86"
    BOOTPROTO="dhcp"
    DEVICE="eth0"
    ONBOOT="yes"
    # cat /etc/sysconfig/network-scripts/ifcfg-eth1
    Code:
    UUID="7be24cfc-a805-46e1-8776-f42a927c7165"
    NM_CONTROLLED="yes"
    HWADDR="00:0E:A6:F9:A3:5B"
    BOOTPROTO="dhcp"
    DEVICE="eth1"
    ONBOOT="no"
    # cat /etc/sysconfig/network
    Code:
    NETWORKING=yes
    HOSTNAME=fedora17
    NTPSERVERARGS=iburst
    # service --status-all
    Code:
    I don't know of any running hsqldb server.
    netconsole module not loaded
    Configured devices:
    lo eth0 eth1
    Currently active devices:
    lo eth0 eth1
    spice-vdagentd.service - LSB: Agent daemon for Spice guests
    	  Loaded: loaded (/etc/rc.d/init.d/spice-vdagentd)
    	  Active: active (exited) since Fri, 16 Nov 2012 21:10:47 +0800; 27min ago
    	 Process: 740 ExecStart=/etc/rc.d/init.d/spice-vdagentd start (code=exited, status=0/SUCCESS)
    	  CGroup: name=systemd:/system/spice-vdagentd.service
    
    tcsd.service - LSB: Init script for TCSD
    	  Loaded: loaded (/etc/rc.d/init.d/tcsd)
    	  Active: failed (Result: exit-code) since Fri, 16 Nov 2012 21:10:47 +0800; 27min ago
    	 Process: 735 ExecStart=/etc/rc.d/init.d/tcsd start (code=exited, status=137)
    	  CGroup: name=systemd:/system/tcsd.service
    
    Nov 16 21:10:47 fedora17 tcsd[735]: Starting tcsd: [FAILED]
    I expect to set up static IP, 192.168.0.11, and use the hostname, fedora17, as server name.

    # hostname
    Code:
    fedora17
    # hostname -f
    Code:
    fedora17
    # cat /etc/hosts
    Code:
    127.0.0.1		localhost.localdomain localhost
    ::1		localhost6.localdomain6 localhost6
    Please advise how to set relevant file/files. TIA

    B.R.
    satimis

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hi,

    You didn't mention which interface you want be static IP 192.168.0.11, but let's say you want it to be eth0. Edit this file:
    Code:
    /etc/sysconfig/network-scripts/ifcfg-eth0
    and make it look like this:
    Code:
    UUID="c29af442-1fb3-44dc-a15a-0159397bbacd"
    NM_CONTROLLED="yes"
    HWADDR="90:F6:52:03:57:86"
    #BOOTPROTO="dhcp"
    BOOTPROTO="static"
    IPADDR="192.168.0.11"
    NETMASK="255.255.255.0"
    DEVICE="eth0"
    ONBOOT="yes"
    Blue lines are the modified/new ones.

    To set your hostname, you'd put it in /etc/sysconfig/network, but you've already done that and it looks corrrect. And the hostname command returns the correct value, so not sure why you're asking about this. If you mean you want your hostname to resolve to the ip address you gave, you could put this in your /etc/hosts file:
    Code:
    192.168.0.11        fedora17
    just make sure there are no other "fedora17" entries in /etc/hosts.

    Also, if your 2nd NIC is getting ip via DHCP, note that DHCP servers can assign clients the hostname, too, so make sure that is not conflicting you.

    And if you want know which device is which (onboard vs PCIe), you can get the driver name, which should lend a clue:
    Code:
    ethtool -i eth0|grep ^driver

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •