kjcsb
2006-Jul-10 21:31 UTC
[asterisk-users] 2 NICs; Asterisk receives on eth1 and replies on eth0
I have an Asterisk server with 2 network cards. One provides the LAN connection and the other provides the Internet connection. Currently this is set up in the following way: eth0 192.168.1.5. This provides LAN connectivity eth1 192.168.1.251, gw 192.168.1.252 (Note that other nodes on the network use a different gateway, not 192.168.1.252). This provides the internet connection. The router is set up with DMZ enabled and pointing to 192.168.1.251. Currently, when a SIP device attempts to register across the internet, the following sip dialogue is observed: U 60.234.nnn.nnn:5060 -> 192.168.1.251:5060 REGISTER sip:60.234.xxx.xxx SIP/2.0..Via: SIP/2.0/UDP 60.234.nnn.nnn;branch=z9hG4bK9d31000024770000..From: "CallerID" <sip:1590@60.234.xxx.xxx>;tag=bec20000273bffff..To: <sip:1590@60.234.xxx.xxx>..Contact: <sip:1590@60.234.nnn.nnn>..Call-ID: 1d19ffff20040000@192.168.0.16..CSeq: 100 REGISTER..Expires: 60..User-Agent: Grandstream HT488 1.0.2.16..Max-Forwards: 70..Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER, OPTIONS,INFO,SUBSCRIBE..Content-Length: 0.... # U 192.168.1.5:5060 -> 60.234.nnn.nnn:5060 SIP/2.0 100 Trying..Via: SIP/2.0/UDP 60.234.nnn.nnn;branch=z9hG4bK9d31000024770000;received=60.234.nnn.nnn..From: "CallerID" <sip:1590@60.234.xxx.xxx>;tag=bec20000273bffff..To: <sip:1590@60.234.xxx.xxx>..Call-ID: 1d19ffff20040000@192.168.0.16..CSeq: 100 REGISTER..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY..Contact: <sip:1590@60.234.xxx.xxx>..Content-Length: 0.... ### U 192.168.1.5:5060 -> 60.234.nnn.nnn:5060 SIP/2.0 401 Unauthorized..Via: SIP/2.0/UDP 60.234.nnn.nnn;branch=z9hG4bK9d31000024770000;received=60.234.nnn.nnn..From: "CallerID" <sip:1590@60.234.xxx.xxx>;tag=bec20000273bffff..To: <sip:1590@60.234.xxx.xxx>;tag=as23747970..Call-ID: 1d19ffff20040000@192.168.0.16..CSeq : 100 REGISTER..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY..Contact: <sip:1590@60.234.xxx.xxx>..WWW-Authenticate: Digest realm="asterisk", nonce="1442f9e8"..Content-Length: 0.... where: 60.234.nnn.nnn is public IP of SIP client 60.234.xxx.xxx is public IP of Asterisk server Asterisk seems to be replying on eth0 whereas the inbound traffic was received on eth1. This leads me to think that there's a better way to configure the network. If anyone could provide some advice I would appreciate it. If the setup is reasonable, how do I get Asterisk to reply on eth1? Thanks in advance Cameron
Daniel Lawson
2006-Jul-10 22:21 UTC
[asterisk-users] 2 NICs; Asterisk receives on eth1 and replies on eth0
kjcsb wrote:> I have an Asterisk server with 2 network cards. One provides the LAN > connection and the other provides the Internet connection. Currently > this is set up in the following way: > > eth0 192.168.1.5. This provides LAN connectivity > > eth1 192.168.1.251, gw 192.168.1.252 (Note that other nodes on the > network use a different gateway, not 192.168.1.252). This provides the > internet connection. The router is set up with DMZ enabled and > pointing to 192.168.1.251.I am going to assume you are using a netmask of 255.255.255.0 above, as you haven't specified it. You can't have both interfaces being on the same network. This is why you are having this problem. I'd suggest making the Asterisk -> upstream link inside a different network, such as 192.168.2.xxx. EG: eth0 192.168.1.25 LAN eth1 192.168.2.1 gw 192.168.2.254 set the router up with DMZ enabled and pointing to 192.168.2.1 I'd also suggest you connect eth1 on the asterisk box directly to the gateway, and don't plug them into your LAN switch. You may need to use a crossover cable to do this.
Dave Cotton
2006-Jul-10 23:23 UTC
[asterisk-users] 2 NICs; Asterisk receives on eth1 and replies on eth0
On Tue, 2006-07-11 at 16:31 +1200, kjcsb wrote:> I have an Asterisk server with 2 network cards. One provides the LAN > connection and the other provides the Internet connection. Currently this is > set up in the following way: > > eth0 192.168.1.5. This provides LAN connectivity > > eth1 192.168.1.251, gw 192.168.1.252 (Note that other nodes on the network > use a different gateway, not 192.168.1.252). This provides the internet > connection. The router is set up with DMZ enabled and pointing to > 192.168.1.251.Two NICs in the same address space? Are you sure the rest of the system works as you think it does? -- Dave Cotton <dcotton@linuxautrement.com>