0

I'm wondering if anyone can give me a rundown for networking configurations in ubuntu when the interfaces are p1p1 etc. I have tried p1p1:0 (like eth0:0) for secondary IPs to no avail. If someone could show me how to modify /etc/network/interfaces when lo and p1p1 to add a secondary IP (using the same interface) I would appreciate it.

Here's what I have (the commented out lines are failed attempts, IPs are intentionally obscured):

# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p1p1
iface p1p1 inet static
        address x.x.x.x
        netmask 255.255.255.248
        network x.x.x.x
        broadcast x.x.x.x
        gateway x.x.x.x
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 8.8.8.8
        dns-search www.google.com

#secondary interface
#auto p2p1
#iface p2p1 inet static
#       address x.x.x.x
#       netmask x.x.x.x
#       network x.x.x.x
#       broadcast x.x.x.x
#       gateway x.x.x.x
#       dns-nameservers 8.8.8.8
#       dns-search www.google.com

#auto p3p1
#iface p3p1 inet static
#       address x.x.x.x
#       netmask 255.255.255.128
#       broadcast x.x.x.x
#       gateway x.x.x.x
#       DNS1=8.8.8.8
#       DNS2=8.8.4.4

If there is another way to add static IPs to the server that would work too.

Thanks!

UKtech2
  • 1
  • 1
  • 1
  • Would you be OK renaming the p1p1 interfaces back to normal eth0? Also, they would be the same format as eth0:0, not p2p1 etc. So you should have p1p1:0. I can post a full config if you'd like. – bhavicp Nov 10 '14 at 01:33

1 Answers1

0

It would be the same way it's done with ethX as the name.

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p1p1
iface p1p1 inet static
        address x.x.x.x
        netmask 255.255.255.248
        network x.x.x.x
        broadcast x.x.x.x
        gateway x.x.x.x
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 8.8.8.8
        dns-search www.google.com

iface p1p1:0 inet static
        address x.x.x.x
        netmask x.x.x.x
        broadcast x.x.x.x

iface p1p1:1 inet static
        address x.x.x.x
        netmask x.x.x.x
        broadcast x.x.x.x

You can also rename your p1p1 interface back to eth0 if you'd like.

cd /etc/udev/rules.d
cp 70-persistent-net.rules 70-persistent-net.rules.bak
nano 70-persistent-net.rules

change

NAME="p1p1" 

to

NAME="eth0"
bhavicp
  • 344
  • 2
  • 8