After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty. Get an ip address for en0: ipconfig getifaddr en0 Same thing, but setting and echoing a variable: ip=`ipconfig getifaddr en0` ; echo $ip View the subnet mask of en0: ipconfig getoption en0 subnet_mask View the dns server for en0: ipconfig getoption en0 domain_name_server Get information about how en0 got its dhcp on: ipconfig getpacket en1 View some network info: ifconfig en0 Set en0 to have an ip address of 10.10.10.10…
-
- iPhone, Mac OS X, Mac OS X Server, Mac Security, Mass Deployment, Microsoft Exchange Server, Network Infrastructure, Ubuntu, Unix, VMware
Quick nmap Hacks
The nmap application is a pretty easy-to-use tool that can be used to port scan objects in a network environment. To obtain mmap in an easy-to-use package installer, for OS X check out the download page at http://nmap.org/download.html#macosx (use the same page to grab it for Windows or *nix as well). Once downloaded run the package/rpm/whatever. Before I scan a system, I like to pull the routing table and eth info to determine how scans are being run, which can be run by using the mmap command anong with the —iflist option: nmap —iflist Basic Scanning To then scan a computer, just use the mmap command followed by the host…
-
More Information About DHCP Leases in OS X
You can obtain a pretty decent amount of information about leases your OS X computer gets just by looking in the Network System Preference pane, for each interface. However, you can get a little lot more information, as with most things, from the command line. First, we’re going to take a look at en0 on our host and see what the MAC address is: ifconfig en0 ether Now, we can look in the /var/db/dhcpclient/leases directory to see a list of all of the leases we have running on our system. Based on the MAC address of our computer, we should see a file there that starts with the name of…
-
Setting Up Multiple IPs in Ubuntu
A standard network interface will look similar to the following in /etc/network/interfaces: auto eth0 iface eth0 inet static address 192.168.210.100 netmask 255.255.255.0 broadcast 192.168.210.255 gateway 192.168.210.1 Adding more IP addresses to those interfaces is as simple as creating an alias, done by duplicating the information for the initial interface and appending a colon followed by 0,1,2,3,etc according to how many aliases are needed, minus the gateway (the initial IPs gateway will be used): auto eth0:0 iface eth0:0 inet static address 192.168.210.101 netmask 255.255.255.0 broadcast 192.168.210.255 auto eth0:1 iface eth0:1 inet static address 192.168.210.102 netmask 255.255.255.0 broadcast 192.168.210.255 When finished, run an ifconfig to verify that the new interfaces are up…