multiple IP on 1 PHY

Issues related to configuring your network
Post Reply
kondrik
Posts: 2
Joined: 2014/07/31 02:32:41

multiple IP on 1 PHY

Post by kondrik » 2014/07/31 02:55:26

How can i set 2-3 IP on 1 PHY interface ?

I tries:

Code: Select all

cat /etc/sysconfig/network-scripts/ifcfg-enp4s0
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT=no
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp4s0"
UUID="de031a23-d94e-4923-bd86-83f76322f7fc"
ONBOOT="yes"
IPADDR0="192.168.5.1"
PREFIX0="24"
GATEWAY0="192.168.5.2"
DNS1="192.168.5.2"
DNS2="8.8.8.8"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"

IPADDR1="192.168.122.1"
HWADDR=00:25:90:53:D1:5F
PREFIX1=24
But after reboot i got only

Code: Select all

enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.5.1  netmask 255.255.255.0  broadcast 192.168.5.255
        inet6 fe80::225:90ff:fe53:d15f  prefixlen 64  scopeid 0x20<link>
        ether 00:25:90:53:d1:5f  txqueuelen 1000  (Ethernet)
        RX packets 147566  bytes 18191351 (17.3 MiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 88113  bytes 7175920 (6.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17  memory 0xdf900000-df920000
, at this PHY

p.s. i am new to centOS, before was ubuntu/debian

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: multiple IP on 1 PHY

Post by TrevorH » 2014/07/31 08:32:11

You probably also need a PREFIX1= and then use the /sbin/ip command to list ip addresses not the old, deprecated ifconfig. Use ip a l
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

kondrik
Posts: 2
Joined: 2014/07/31 02:32:41

Re: multiple IP on 1 PHY

Post by kondrik » 2014/08/01 08:54:03

Strange, unusual, but works :D Thx.

May be you can help me to understand, how to work with "ip" ?

How to:
1. Add new IP address to interface enp3s0 ?
2. Change one of IP at interface enp3s0 from 192.168.5.1 to 192.168.5.2 ?
3. Remove one of IP at interface enp4s0 ?
4. Set interface UP/DOWN ?

User avatar
apach
Posts: 5
Joined: 2011/07/21 19:29:58
Location: Ukraine/Lviv

Re: multiple IP on 1 PHY

Post by apach » 2014/08/07 19:08:05


Post Reply