столкнулся с проблемов – перестал на маке работать получение DHCP адреса от роутера через ethernet (через вайфАЙ все ОК)
перечень утилит на посмотреть под катом
там же набор вариантов для решения проблемы
ipconfig
usage: ipconfig command args
where command is one of waitall, getifaddr, ifcount, getoption, getpacket, set, setverbose
Netinfo is gone as of Leopard (October 2007).
Netinfo is Mac OS X’s way of bringing order from the chaos of Unix configuration files. While I understand the motivation, it was and remains a horribly bad idea.
$ lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
firefox-b 935 apl 9u IPv4 0×02cff7d4 0t0 TCP 10.1.3.203:60047->64.233.163.83:http (ESTABLISHED)
firefox-b 935 apl 43u IPv4 0×0288d50c 0t0 TCP 10.1.3.203:57001->94.70-84-79.reverse.theplanet.com:http (CLOSED)
firefox-b 935 apl 50u IPv4 0×0288ef58 0t0 TCP localhost:51780->localhost:51779 (TIME_WAIT)
http://aplawrence.com/Unixart/bbsambanetwork.html
netstat -r
nslookup – проверка работы DNS в терминале
traceroute
route [-n] command [-net | -host] destination gateway [netmask]
Маны по командам
http://developer.apple.com/documentation/Darwin/Reference/ManPages/index.html#//apple_ref/doc/framework/manpages
http://www.macosxhints.com/article.php?story=20051020014120761
описана проблема со сменой имен сетевых интерфейсов. может быть связано с настройкой DHCP
Now, imagine the following three possible scenarios for a computer with the above specifications:
1. You replace (or upgrade) the PCI Ethernet card in a tower.
2. You move a hard drive from one tower to another tower with similarly two Ethernet interfaces (perhaps a brain/hard drive transfer, AKA a massive hardware upgrade).
3. You clone a hard drive from one tower to another tower with similarly two Ethernet interfaces (perhaps as a backup for a mission-critical server or workstation).
Now your two Ethernet interfaces are named en0 (built-in) and en2 (PCI card). Why is the PCI card now labeled as en2 instead of en1, and why is that possibly bad?
I’ll answer the second question first. That’s possibly bad if you have a bunch of configuration files that specifically refer to en1. For instance, a firewall/gateway computer that bridges en0 (internet interface) to en1 (LAN interface). If en1 doesn’t exist, then all of your LAN traffic won’t go anywhere and won’t do anything. This has implications for your IPFW2 startup and configuration files, and also your DHCPD startup files.
So why does the system exhibit this behavior? Because there are files in your system which record very specific information about your secondary Ethernet interface. If the information does not exactly match, then the system keeps the old information linked with the en1 BSD name, and creates a new BSD name for the new ethernet interface. So how do you solve this problem? There are two solutions:
1. You can hand edit your configuration files, replacing en1 with en2. That’s lame, especially if you miss any iterations (it’s like looking for a needle in a haystack), or if you have to make another transition in the future.
2. Before you make the transition, record all of the pertinent settings and modes from the Network System Preferences pane. Actually, you should have this information backed-up in a dead-tree edition in case of a catastrophic failure anyway. Then make your transition. Once complete, boot your modified tower and move the following files to a safe location (your Desktop, perhaps). Here is a cute command line command which you can enter into the Terminal.app [the following command is all one line; the backslashes should allow a copy and paste to work]:
sudo mv /Library/Preferences/SystemConfiguration
/NetworkInterfaces.plist /Library/Preferences/SystemConfiguration
/preferences.plist ~username/Desktop
Enter your admin password, then restart your computer. Once restarted, you will need to re-enter your settings and modes into your now blank Network preference pane. Also, you will need to update your Computer Name in the Sharing preference pane.
Unfortunately, this isn’t a check-box-one-click-solution (read: instant-gratification fix), but it’s pretty quick, and it saves you from having to nano-dive through a bunch of flat files. Also, this provides you a couple of simple options for hardware updates and backups that require very minimal downtime.
Выключить стелс режим и блокирование UDP пакетов
It turns out that Tiger introduced a GUI firewall feature under the Advanced button on the firewall, and in my zeal to secure the PowerMac G5, I turned on Stealth Mode and Block UDP packets. Internet Sharing only worked once I turned these two options off. Then instantly, everything worked as it should.
Share internet connections on a 192.168.x.x network
Интересный скрипт
At the office and connected via AirPort, I get an address on the 192.168.2.x network. Unfortunately, if I attempt to use internet connection sharing (in the Sharing Preferences panel), this conflicts with the built-in 192.168.2.x addressing scheme that OS X uses. Here’s a workaround…
Set your internal IP address on en0 (built-in Ethernet) to whatever non-routable address you like — i.e. 192.168.x.x or 172.16.x.x or 10.x.x.x. Then cut and paste the following into your favorite Terminal-based text editor. Save it as simple_natd.
#!/bin/bash
interface=»$1″
if [ "$interface" = "" ] ; then
echo «I need an interface to NAT on»
exit 1
fi
echo «you may need to run ‘ipfw flush’»
natd=`ps awux |grep -v grep|grep -v $0|grep natd|awk ‘{print $2}’`
kill -9 $natd
sleep 1
sysctl -w net.inet.ip.forwarding=1
alias_ip=$(ifconfig $interface | grep inet | grep -v inet6 | \
awk ‘{print $2}’ | head -1)
/usr/sbin/natd -alias_address $alias_ip -interface $interface -use_sockets \
-same_ports -unregistered_only -dynamic -clamp_mss
#ipfw -f flush
ipfw add divert natd ip from any to any via «$interface»
Run the simple_natd script in terminal to enable NAT for computers on your built-in ethernet (en0) network from your network connection on the Airport card (en1):
sudo bash simple_natd en1
Remember to make the script executable first.
Открытие порта через терминал
sudo ipfw add 3000 allow tcp from any to any via fw?
where ? is the firewire device indicated in netstat -nr