Re: Problem setting up alias ip address
site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=Wzm2+VWjnnNYsMW3FxS1UaRGGQWmCT41zOihAbdy+L8=; b=g31xZYLKW/wVg/jxR7x0WZ0bI923V0zdBxtCHLIMk4TsPPEgioHYlBEV7O/2CVrWYj f+FSInvzoMoTEdTOef6X+bo4uyqg5O0MVNRmYgnYKu0WaAN3QJ0Y3amkz0FtlH1LooG8 J8s96ft4wTPvmPMozWEbNkxQJ3wBK6RF+ib3c= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=aFclQ25qLfqgeiv9rllUKoUJpdcpWxKwkfuqOWx7uYVKyEJCyQ3ukw1JG+9j+D8zqV RiAUZqYA88GEpl1soHsPCMYdT7wkU4Ty0D3z8/0i+amUzBBXQAdwMPV51JUlZaOUsAXb pUkrnM9DzkbOVpDLrkwxtj0fL8UeeVf5UEQJA= Hmm, Have read today that (according to this link) http://docs.huihoo.com/darwin/opendarwin/articles/network_config/ar01s03.htm... The routing table should be taken care of by ifconfig, however I may have had an incorrect netmask. So retried with a new ip number on different netmask... $ sudo ifconfig ppp0 192.168.22.22 192.168.2.1 netmask 255.255.255.0 alias $ ifconfig ppp0 ppp0: flags=8011<UP,POINTOPOINT,MULTICAST> mtu 1448 inet 10.64.64.64 --> 192.168.2.1 netmask 0xffffff00 inet 192.168.22.22 --> 192.168.2.1 netmask 0xffffff00 $ sudo tcpdump -i ppp0 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on ppp0, link-type PPP (PPP), capture size 65535 bytes 13:50:25.954581 IP 192.168.0.50.63626 > 192.168.2.1.nat-pmp: UDP, length 2 13:50:25.998323 IP 192.168.2.1 > 192.168.0.50: ICMP 192.168.2.1 udp port nat-pmp unreachable, length 38 This above activity is through the 192.168.22.22 alias address. janitors-Mac-mini:~ id$ nmap 192.168.22.22 -PN Starting Nmap 5.21 ( http://nmap.org ) at 2010-06-03 13:55 BST Strange error from connect (65):No route to host Nmap scan report for 192.168.22.22 Host is up. All 1000 scanned ports on 192.168.22.22 are filtered Nmap done: 1 IP address (1 host up) scanned in 15.16 seconds What could possibly be wrong? The non-aliased address seems fine: janitors-Mac-mini:~ id$ nmap 192.168.0.50 -PN Starting Nmap 5.21 ( http://nmap.org ) at 2010-06-03 13:56 BST Nmap scan report for 192.168.0.50 Host is up (0.00066s latency). Not shown: 965 closed ports, 31 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 548/tcp open afp 9091/tcp open unknown Nmap done: 1 IP address (1 host up) scanned in 6.18 seconds On Wed, Jun 2, 2010 at 9:53 PM, Dreamcat Four <dreamcat4@gmail.com> wrote:
Hi, Having problems sending data over an ifconfig alias address.
To create the alias address i am using: $ ifconfig ppp0 alias <extra ip local address> <remote gateway addr> netmask 255.255.255.0
Where ppp0 is already up, (and set by the VPN server as a dynamic IP address). But our aim is to assign locally a static IP address. So that can be bind()'d to. I would otherwise modify the client app to use SO_BINDTODEVICE. However there is no such feature on Mac OS X.
So, moving on. This ipconfig alias address seems to almost work (or partially). Because outgoing packets sent to the new alias address ".111" will all appear on the ppp0 interface.
But rather than going from the alias address -> destination address, the packet appears there to be going from the local ppp0 assign "real address" (192.168.0.26) -> (192.168.0.111). So they go nowhere.
janitors-Mac-mini:peers id$ nmap 192.168.2.1 # ppp0 remote address
janitors-Mac-mini:peers id$ sudo tcpdump -i ppp0 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on ppp0, link-type PPP (PPP), capture size 65535 bytes 14:31:55.350430 IP 192.168.0.26.59258 > 192.168.0.111.http: Flags [S], seq 1400391633, win 65535, options [mss 1404,nop,wscale 3,nop,nop,TS val 95271349 ecr 0,sackOK,eol], length 0 14:31:55.350576 IP 192.168.0.26.59259 > 192.168.0.111.https: Flags [S], seq 3103647381, win 65535, options [mss 1404,nop,wscale 3,nop,nop,TS val 95271349 ecr 0,sackOK,eol], length 0
Perhaps some packet-rewriting rule is also needed? Any help would be great, thanks.
dreamcat4 dreamcat4@gmail.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Dreamcat Four