View Single Post
Old 25th December 2008
dextro dextro is offline
Port Guard
 
Join Date: Dec 2008
Posts: 21
Default

Okay, the following creates a virtual interface named ngeth0 and bridges it with nfe0 (my modem nic)

Code:
 ngctl mkpeer . eiface hook ether
 ifconfig ngeth0 up
 ngctl mkpeer ngeth0: bridge lower link0
 ngctl name ngeth0:lower mybridge
 ngctl connect nfe0: mybridge: lower link1
 ngctl connect nfe0: mybridge: upper link2
 ngctl connect ngeth0: mybridge: upper link3
 ngctl msg nfe0: setautosrc 0
 ngctl msg nfe0: setpromisc 1
 ifconfig ngeth0 link 00:5c:16:10:dd:79
 dhclient ngeth0
The point is so I can obtain a second IP via DHCP. At this point everyone seems to tell me about ifconfig alias... its not an option.
Moving on, everything seems to work great except when I try and use ngeth0 it just uses nfe0 IP.

Code:
gateway# ping -S 216.232.234.205 google.ca
PING google.ca (64.233.161.104) from 216.232.234.205: 56 data bytes
64 bytes from 64.233.161.104: icmp_seq=0 ttl=245 time=130.315 ms
64 bytes from 64.233.161.104: icmp_seq=1 ttl=245 time=129.767 ms
^C
--- google.ca ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 129.767/130.041/130.315/0.274 ms

gateway# ping -S 216.232.253.26 google.ca
PING google.ca (64.233.187.104) from 216.232.253.26: 56 data bytes
64 bytes from 64.233.187.104: icmp_seq=0 ttl=246 time=117.465 ms
64 bytes from 64.233.187.104: icmp_seq=1 ttl=246 time=118.204 ms
^C
--- google.ca ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 117.465/117.834/118.204/0.370 ms

gateway#
Looks good right? wrong! tcpdump:

Code:
16:15:50.372500 IP d216-232-234-205.bchsia.telus.net > od-in-f104.google.com: ICMP echo request, id 36101, seq 0, length 64
16:15:50.502758 IP od-in-f104.google.com > d216-232-234-205.bchsia.telus.net: ICMP echo reply, id 36101, seq 0, length 64
16:15:51.374205 IP d216-232-234-205.bchsia.telus.net > od-in-f104.google.com: ICMP echo request, id 36101, seq 1, length 64
16:15:51.503924 IP od-in-f104.google.com > d216-232-234-205.bchsia.telus.net: ICMP echo reply, id 36101, seq 1, length 64

16:15:53.133567 IP d216-232-234-205.bchsia.telus.net > jc-in-f104.google.com: ICMP echo request, id 21409, seq 0, length 64
16:15:53.250960 IP jc-in-f104.google.com > d216-232-234-205.bchsia.telus.net: ICMP echo reply, id 21409, seq 0, length 64
16:15:54.135215 IP d216-232-234-205.bchsia.telus.net > jc-in-f104.google.com: ICMP echo request, id 21409, seq 1, length 64
16:15:54.253380 IP jc-in-f104.google.com > d216-232-234-205.bchsia.telus.net: ICMP echo reply, id 21409, seq 1, length 64
also some ifconfig

Code:
gateway# ifconfig nfe0
nfe0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 00:14:2a:19:c4:a5
        inet 216.232.234.205 netmask 0xfffff000 broadcast 216.232.239.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

gateway# ifconfig ngeth0
ngeth0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:5c:16:10:dd:79
        inet 216.232.253.26 netmask 0xfffff000 broadcast 216.232.255.255

gateway#
Reply With Quote