Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

20090328

Mac OS X ipfw traffic shaping

It's related to my common problem with images upload. When I start to upload a new set of pictures the rest of traffic on my isp network connection is being reduced almost to zero.

To decrease the available bandwidth to a flickr website, I've used below commands:

% sudo ipfw pipe 1 config bw 256kbit/s

% sudo ipfw pipe show
00001: 256.000 Kbit/s 0 ms 50 sl. 0 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000

% sudo ipfw add pipe 1 dst-ip 87.248.121.213 dst-port 80
33400 pipe 1 ip from any to any dst-ip 87.248.121.213 dst-port 80

% sudo ipfw show
33300 0 0 deny icmp from any to me in icmptypes 8
33400 1492 2084081 pipe 1 ip from any to any dst-ip 87.248.121.213 dst-port 80

% sudo ipfw pipe show
00001: 256.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 tcp 192.168.1.101/57602 87.248.121.213/80 437 611800 46 64400 0

When the job is completed:

% sudo ipfw delete 33400

OR /if there's no other pipes/

% sudo ipfw pipe flush
Are you sure? [yn] y

Flushed all pipes.

20080413

OpenSolaris on MacBook Pro

The purpose of this post is not to give the recipe for an overall installation.
I've written down a few notes about the network configuration.

I've used the Parallels virtualization and OpenSolaris b79b. Parallels emulates the Realtek 8029(AS) network card but there's no support inside the OS.
To complete this task perform the following steps:

1. Mount vmtools.iso as CD/DVD-ROM (/Library/Parallels/Tools/vmtools.iso)
2. Turn off the eeprom DMA property (atapi-cd-dma-enabled) - before the boot process edit the grub menu list (press 'e') and add the following to the kernel line:

grub edit> kernel$ /platform/i86pc/kernel/$ISADIR/unix -B atapi-cd-dma-enabled=0

Boot with a 'b' key.
3. Install the requested driver:

# cd /cdrom/prltools/Drivers/Network/RTL8029/SOLARIS
# ./network.sh
[...]
Will you receive IP address from DHCP server (Y/N)


If you've chosen the answer 'N', enter the requested values:

Enter IP address of the virtual machine:
Enter network address:
Enter network mask:
Enter default gateway IP address:


The script will modify the following files:
/etc/inet/hosts
/etc/hostname.ni0
/etc/netmasks
/etc/defaultrouter
or
/etc/dhcp.ni0
/etc/hostname.ni0
(if the 'Y' have been chosen)

Now, reboot the system.

During the boot process you could see the information:

WARNING: ni0: niattach: SA_eeprom is funny, assuming byte-mode

but everything should be just fine.