[indiana-discuss] Help with static IP address and link aggregation
David Abrahams
dave at boostpro.com
Thu Jun 11 10:32:29 PDT 2009
on Thu Jun 11 2009, "Fajar A. Nugraha" <fajar-AT-fajar.net> wrote:
> On Thu, Jun 11, 2009 at 7:37 PM, David Abrahams<dave at boostpro.com> wrote:
>>
>> Hi,
>>
>> I have a couple of links I want to aggregate with a static IP address.
>> Should be simple, right? Well, just getting a static IP address set up
>> turns out to be challenging at best. I've done a lot of googling, and
>> found a *lot* of people having trouble with it, too. The first
>> instructions I found that actually worked for me happen to use NWAM:
>> http://bopl.samharris.us/2008/06/solaris-nwam-and-static-ips/ I'd be
>> happy to use the "default" network service instead, but haven't been
>> able to get DNS name lookup to work.
>
>
> (1) disable nwam, enable network/physical:default (I think you get this already)
> (2) backup the default /etc/nsswitch.conf
> (3) copy /etc/nsswitch.conf.dns to /etc/nsswitch.conf <== this might
> be your pitfall
> (4) adjust /etc/resolv.conf as necessary
> (5) set up link aggregation with dladm. Lets call this bond0
> (6) ifconfig bond0 plumb
> (7) setup networking manually with ifconfig and route
> (8) test
Yes!!
> (9) if you're happy with the results, create/adjust /etc/hosts,
> /etc/hostname.bond0, /etc/defaultrouter, and /etc/netmasks (classic
> solaris networking, really)
No... :(. Browsing inside my local subnet works, but outside fails.
$ tail /var/svc/log/network-physical\:default.log
[ Jun 11 13:06:58 Enabled. ]
[ Jun 11 13:06:59 Executing start method ("/lib/svc/method/net-physical"). ]
svcprop: Couldn't find property group `system' for instance `svc:/system/svc/restarter:default'.
[ Jun 11 13:07:00 Timeout override by svc.startd. Using infinite timeout. ]
configuring IPv4 interfaces: bond0.
add net default: gateway 192.168.188.1
[ Jun 11 13:07:03 Method "start" exited with status 0. ]
$ host yahoo.com
yahoo.com has address 69.147.114.224
yahoo.com has address 209.131.36.159
yahoo.com has address 209.191.93.53
yahoo.com mail is handled by 1 e.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 f.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 g.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 a.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 b.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 c.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 d.mx.mail.yahoo.com.
$ traceroute yahoo.com
traceroute: unknown host yahoo.com
And here's how I got there. Comments begin with "!!!". Did I mention
"thank you?" :-)
(1) disable nwam, enable network/physical:default
# svcadm disable network/physical:nwam
# svcadm disable network/physical:default
(2) backup the default /etc/nsswitch.conf
# cp /etc/nsswitch.conf /etc/nsswitch.conf.bak
(3) copy /etc/nsswitch.conf.dns to /etc/nsswitch.conf
# cp /etc/nsswitch.conf.dns /etc/nsswitch.conf
cp: cannot access /etc/nsswitch.conf.dns
!!! Whoa, I didn't even notice that error when I did this originally; I
just assumed the command had succeeded. The odd thing is that there
used to be a variety of /etc/nsswitch.conf.* files but now (after
following the whole procedure) they are all missing. I have no idea
why the above command failed, though; I'm pretty sure the file was
there.
(4) adjust /etc/resolv.conf as necessary
# cat /etc/resolv.conf
domain luannocracy.com
# Technically, the following should work because it forwards to
# the real DNSes:
#
# nameserver 192.168.188.1
#
# But so should this:
nameserver 207.172.3.8
nameserver 207.172.3.9
nameserver 207.172.3.10
nameserver 207.172.3.11
(5) set up link aggregation with dladm. Lets call this bond0
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
ether 8:0:27:fb:6d:6f
e1000g1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
ether 8:0:27:35:91:c9
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
inet6 ::1/128
# ifconfig e1000g0 down unplumb
# ifconfig e1000g1 down unplumb
# dladm create-aggr -d e1000g0 -d e1000g1 bond0
(6) ifconfig bond0 plumb
# ifconfig bond0 plumb
(7) setup networking manually with ifconfig and route
# ifconfig bond0 inet 192.168.188.44/24 broadcast + up
# netstat -nr
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
192.168.188.0 192.168.188.44 U 1 0 bond0
127.0.0.1 127.0.0.1 UH 1 35 lo0
Routing Table: IPv6
Destination/Mask Gateway Flags Ref Use If
--------------------------- --------------------------- ----- --- ------- -----
::1 ::1 UH 1 0 lo0
# ping 192.168.188.1
192.168.188.1 is alive
# host yahoo.com # (no response)
^C
# route -p add default 192.168.188.1
add net default: gateway 192.168.188.1
add persistent net default: gateway 192.168.188.1
# netstat -nr
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 192.168.188.1 UG 1 0
192.168.188.0 192.168.188.44 U 1 1 bond0
127.0.0.1 127.0.0.1 UH 1 35 lo0
Routing Table: IPv6
Destination/Mask Gateway Flags Ref Use If
--------------------------- --------------------------- ----- --- ------- -----
::1 ::1 UH 1 0 lo0
(8) test
# host yahoo.com
yahoo.com has address 69.147.114.224
yahoo.com has address 209.131.36.159
yahoo.com has address 209.191.93.53
yahoo.com mail is handled by 1 e.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 f.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 g.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 a.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 b.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 c.mx.mail.yahoo.com.
yahoo.com mail is handled by 1 d.mx.mail.yahoo.com.
# firefox
...etc...
!!! Browsing inside and outside my local subnet works; ssh works; Very
nice!
(9) if you're happy with the results, create/adjust /etc/hosts,
/etc/hostname.bond0, /etc/defaultrouter, and /etc/netmasks (classic
solaris networking, really)
# cat /etc/hosts
# CDDL HEADER START
# ...
::1 solo solo.local localhost loghost
127.0.0.1 solo.local localhost loghost
# cat /etc/hostname.bond0
192.168.188.44/24
!!! Note: I had initially written "solo.luannocracy.com" but had
problems at restart that prevented the network service from
/var/svc/log/network-physical:default.log ended with:
[ Executing start method ("/lib/svc/method/net-physical"). ]
svcprop: Couldn't find property group `system' for instance `svc:/system/svc/restarter:default'.
[ Timeout override by svc.startd. Using infinite timeout. ]
configuring IPv4 interfaces:ifconfig: solo.luannocracy.com: bad address
add net default: gateway 192.168.188.1: Network is unreachable
[ Method "start" exited with status 96. ]
# cat /etc/defaultrouter
192.168.188.1
# cat /etc/netmasks
#
# CDDL HEADER START
# ...
192.168.188.0 255.255.255.0
Thanks,
--
Dave Abrahams
BoostPro Computing
http://www.boostpro.com
More information about the indiana-discuss
mailing list