LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 07-07-2005, 07:04 AM   #1
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
default route: strange behaviour


Hi all!

I know this question will look stupid... but, anyhow, I just don't know why this doesn't work.
I wanted to give a try to netbsd, I had allready try to install it, but my dd isn't recognized by the installer: it can see it, but not write on it... that's a bit of a problem.

I also wanted to try qemu, an emulator, so I installed qemu on my debian and installed a netbsd and winXP image.

my windows image works quite well, I can access both my lan and the internet. So that's not a qemu issue, nor a config problem from my Linux box.

on my netbsd, I did the following:
Code:
# ifconfig ne2 172.20.0.2/16
# ping 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56 bytes of data.
64 bytes from 172.20.0.1: icmp_seq=1 ttl=255 time=0.941 ms
64 bytes from 172.20.0.1: icmp_seq=2 ttl=255 time=0.265 ms
# route add default 172.20.0.1
add net default: gateway 172.20.0.1
# ping 172.20.0.1
no answer!
# route delete default 172.20.0.1
delete net default: gateway 172.20.0.1
# ping 172.20.0.1
64 bytes from 172.20.0.1: icmp_seq=1 ttl=255 time=0.941 ms
64 bytes from 172.20.0.1: icmp_seq=2 ttl=255 time=0.265 ms
so, as soon as I configure a default gateway, I loose the connexion with the debian box!
of course, I cannot ping the lan or internet either.

What's more, after adding the default route I cannot even ping my netBSD's own IP!

I als tried to add:
Code:
defaultrouter="172.20.0.1"
in /etc/rc.conf and then restart the network, but the default route isn't taken into account!

so any idea is welcome!

Last edited by fr_laz; 07-07-2005 at 07:29 AM.
 
Old 07-07-2005, 10:21 AM   #2
scuzzo84
Member
 
Registered: Mar 2005
Location: maryland
Distribution: NetBSD
Posts: 60

Rep: Reputation: 15
# route add default 172.20.0.1

or in rc.conf


defaultroute="172.20.0.1"

not

defaultrouter="172.20.0.1"

read guide
 
Old 07-07-2005, 11:24 AM   #3
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Original Poster
Rep: Reputation: 32
thanks... this explains why the route wasn't taken into account in rc.conf... but it gives the same result as in command line: as soon as the route is set up, my interface doesn't answer anymore, I cannot pīng the gateway, nor the NIC's IP itself!
what's more, it doesn't say that the ping were lost... there is no answer at all from the ping command!
I tried a nslookup which doesn't work either (which isn't a surprise).

As for the remark about reading doc... that's what I've done before posting. I know that it's _very_ boring to answer total newby question, and I am one in *bsd - sorry about that.

[edit] Queer: I have no network access from the netBSD virtual box, but I can ping it from the real debian box and from the virtual winXP!

Last edited by fr_laz; 07-07-2005 at 11:26 AM.
 
Old 07-07-2005, 02:53 PM   #4
scuzzo84
Member
 
Registered: Mar 2005
Location: maryland
Distribution: NetBSD
Posts: 60

Rep: Reputation: 15
is this a box or an emulated thing like qemu?

maybe try tcpdump
 
Old 07-08-2005, 06:47 AM   #5
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Original Poster
Rep: Reputation: 32
Hi,

it's an emulated netBSD thanks to qemu (real OS beeing a debian sarge).

here's my routing table (netstat -rn):
Code:
Internet:
Destination        Gateway            Flags     Refs     Use    Mtu  Interface
0/8                link#1             UC          0        0      -  ne2 =>
default            172.22.0.1         UGS         0        4      -  ne3
127/8              127.0.0.1          UGRS        0        0  33196  lo0
127.0.0.1          127.0.0.1          UH          1        0  33196  lo0
172.22/16          link#2             UC          1        0      -  ne3
172.22.0.1         00:ff:19:f6:38:35  UHLc        1        2      -  ne3
my nics are configured this way:
ifconfig ne2 0.0.0.0 (I'll use it later... as a matter of fact, ne2 beeing up or down doesn't change a thing to my problem)
ifconfig ne3 172.22.0.2/16

I made some tests with tcpdump...
My ping make no output (ping -c 3 172.22.0.1 doesn't stop by itself, I must ^C it).
I don't see the pings in tcpdump.
I used tcpdump on the Linux box, it sees nothing as well.

But, I can ssh into my Linux machine, from the netBSD!
And I see these ssh packets in both (Linux & BSD) tcpdump outputs.

when I delete the default route, everything works fine (ping and tcpdump produce their usual output)

so... I'll go on like this, but I really don't understand what happens!
 
Old 07-08-2005, 09:27 AM   #6
scuzzo84
Member
 
Registered: Mar 2005
Location: maryland
Distribution: NetBSD
Posts: 60

Rep: Reputation: 15
I thought you cant change the ips and whatever with qemu and you use ip-nat whatever.....sort of like TAP with linux. I will leave it at this, for me since I recall you cant do this with qemu, I may be wrong.
 
Old 07-08-2005, 09:57 AM   #7
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Original Poster
Rep: Reputation: 32
Hi,

well, usually, you'll use the user-net option of qemu to configure nat in the real box. So as all is configured, you don't have to change network settings.
but I wanted to test inter-vlan routing, clustering and other things which need more machines and network equipement than I have...

so I use tun interfaces that I connect together through brctl (Linux bridging tool). That works very well: every virtual machine I've set up appear as if they were on the same switch, and I'll be able to configure vlans on the real linux box, I'll use the netBSD to set up a virtual gateway between the vlans I'll configure and the real network... at the moment I'm looking at pf which looks to be more powerfull than iptables...

thanks for your replies!

Last edited by fr_laz; 07-08-2005 at 09:58 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange behaviour Anmol SUSE / openSUSE 2 10-27-2005 11:05 PM
strange pipe behaviour brumela Linux - Newbie 8 10-27-2004 12:03 PM
Route to subnet exists but I get "Network unreachable" when adding default route fciuffani Linux - Networking 4 08-18-2004 02:11 PM
Strange Gnome/X Behaviour blaroe Mandriva 0 10-13-2003 01:12 PM
Strange Behaviour mikeyt_3333 Linux - General 4 08-06-2001 03:07 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 08:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration