TritonDataCenter / illumos-joyent

Community developed and maintained version of the OS/Net consolidation
http://www.illumos.org/projects/illumos-gate
266 stars 111 forks source link

lx-brand: make ipadm behave like in smartmachines #54

Closed sjorge closed 8 years ago

sjorge commented 9 years ago

Being able to use ipadm like we can in native zones to configure the network stack would be nice. Currently delete-if and create-if seem to be working, but that's about it.

create-addr results in:

ipadm: Error in setting local address: Operation failed
pfmooney commented 9 years ago

This probably relates to OS-4335 and OS-4336.

sjorge commented 9 years ago

Can confirm: chroot /native /usr/sbin/ipadm create-if -t eth0 works! ugly but usable!

sjorge commented 9 years ago

FWIW, once you get ipadm fixed so it is more user friendly (aka no chroot hack) it is pretty trivial to setup ipv6 and ipv4 :+1:

linux netstat -r ignores all ipv6 stuff though, reason I am using native below.

root@c983ebf0-3785-4c52-8cdf-aa5dccfa3031:~# chroot /native ipadm show-addr ; chroot /native netstat -r
ADDROBJ           TYPE     STATE        ADDR
lo0/_a            static   ok           127.0.0.1/8
eth0/v4static     static   ok           172.16.10.150/24
eth1/v4static     static   ok           172.16.20.150/24
lo0/?             static   ok           ::1/128
eth0/v6local      addrconf ok           fe80::215:ff:fe05:d2a4/10
eth0/v6static     static   ok           2001:6f8:xxxx:10::150/64
eth1/v6local      addrconf ok           fe80::215:ff:fe05:d2a3/10
eth1/v6static     static   ok           2001:6f8:xxxx:20::150/64

Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface
-------------------- -------------------- ----- ----- ---------- ---------
default              172.16.10.1          UG        2          2
localhost            localhost            UH        2          0 lo0
172.16.10.0          172.16.10.150        U         3          0 eth0
172.16.20.0          172.16.20.150        U         2          0 eth1

Routing Table: IPv6
  Destination/Mask            Gateway                   Flags Ref   Use    If
--------------------------- --------------------------- ----- --- ------- -----
::1                         ::1                         UH      2       0 lo0
2001:6f8:xxxx:20::/64       2001:6f8:xxxx:20::150       U       2       0 eth1
2001:6f8:xxxx:10::/64       2001:6f8:xxxx:10::150       U       3       3 eth0
fe80::/10                   fe80::215:ff:fe05:d2a3      U       2       0 eth1
fe80::/10                   fe80::215:ff:fe05:d2a4      U       2       0 eth0
default                     2001:6f8:1480:10::1         UG      2       8
root@c983ebf0-3785-4c52-8cdf-aa5dccfa3031:~# (ip a ; netstat -r) | sed 's/xxxx/xxxx/g'
1: lo: <LOOPBACK,MULTICAST,UP> mtu 8232
    link/loopback 00:00:00:00:00:00
    inet 127.0.0.1/8 scope global dynamic
    inet6 ::1/128 scope global dynamic
6: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qlen 1
    link/ether 00:15:00:05:d2:a4
    inet 172.16.10.150/24 scope global dynamic
    inet6 fe80::215:ff:fe05:d2a4/10 scope global dynamic
    inet6 2001:6f8:xxxx:10::150/64 scope global dynamic
7: eth1: <BROADCAST,MULTICAST,UP> mtu 9000 qlen 1
    link/ether 00:15:00:05:d2:a3
    inet 172.16.20.150/24 scope global dynamic
    inet6 fe80::215:ff:fe05:d2a3/10 scope global dynamic
    inet6 2001:6f8:xxxx:20::150/64 scope global dynamic
6: eth0:1: <MULTICAST,UP> mtu 1500 qlen 1
    link/ether 00:15:00:05:d2:a4
    inet 172.16.10.150/24 scope global dynamic
    inet6 fe80::215:ff:fe05:d2a4/10 scope global dynamic
    inet6 2001:6f8:xxxx:10::150/64 scope global dynamic
7: eth1:1: <MULTICAST,UP> mtu 9000 qlen 1
    link/ether 00:15:00:05:d2:a3
    inet 172.16.20.150/24 scope global dynamic
    inet6 fe80::215:ff:fe05:d2a3/10 scope global dynamic
    inet6 2001:6f8:xxxx:20::150/64 scope global dynamic
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         exosphere-vlan1 0.0.0.0         UG        0 0          0 eth0
172.16.10.0     *               255.255.255.0   U         0 0          0 eth0
172.16.20.0     *               255.255.255.0   U         0 0          0 eth1
sjorge commented 8 years ago

Seems to work now that OS-4335 and OS-4336 are fixed.