alanfleming
Posts: 2
Joined: Thu Jun 13, 2019 9:26 pm

Cannot bridge eth0 and tap0 for SIMH - can't ping default gateway or beyond?

Mon Jun 17, 2019 9:53 pm

I'm trying to get bridged networking up and working on a copy of Stretch downloaded yesterday, for use with SIMH. My problem is that while I can ping by IP address anything locally, I can't ping my default gateway or anything beyond it.

I've followed the up to date advice on here

creating the interfaces only in /etc/network/interfaces:

Code: Select all

auto eth0
iface eth0 inet manual

auto tap0
iface tap0 inet manual
  pre-up tunctl -t tap0 -u username
  up ifconfig tap0 up
  down ifconfig tap0 down

auto br0
iface br0 inet manual
  pre-up ifconfig tap0 up
  bridge_ports tap0 eth0
  bridge_stp off
  bridge_maxwait 5
And doing interface config in /etc/dhcpcd.conf:

Code: Select all

denyinterfaces eth0 tap0

interface br0
static ip_address=192.168.1.201/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
And this gives me what I think I'm supposed to have: (slightly trimmed)

Code: Select all

$ ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.201  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::340f:18ff:fe18:f867  prefixlen 64  scopeid 0x20<link>
        ether 36:0f:18:18:f8:67  txqueuelen 1000  (Ethernet)
        RX packets 1207  bytes 132575 (129.4 KiB)
        RX errors 0  dropped 132  overruns 0  frame 0
        TX packets 285  bytes 35476 (34.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether b8:27:eb:e3:63:ba  txqueuelen 1000  (Ethernet)
        RX packets 1263  bytes 154386 (150.7 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 288  bytes 35742 (34.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 36:0f:18:18:f8:67  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
So br0 with an ip address, and nothing else with one. Routing table looks as you'd expect.

From the pi, I can ping both inside and outside the network. From an emulated machine attached to tap0, I can only ping devices on the local 192.168.1.0 network, not including the default gateway 192.168.1.1 or anything beyond it. When pinging, it looks as if packets don't end up on their correct interfaces - if I were pinging from the emulated machine, its (on tap0) TX packet numbers would go up, but RX packets would remain near 0.

Giving each interface its own IP address creates routing table complications, of course.

Can anyone advise here? I've had this working before (briefly) but didn't save the configuration.

epoch1970
Posts: 3082
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Cannot bridge eth0 and tap0 for SIMH - can't ping default gateway or beyond?

Tue Jun 18, 2019 12:10 am

The bridge looks like it is working since eth is working.

Could be user access rights on tap. Try -u root with tunctl.

Using something less complicated than an emulator to validate that network setup could be an idea, also.

(tunctl and ifconfig and brctl are antiquated by "ip" commands -although brctl is still useful IMHO).
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Ernst
Posts: 1141
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Cannot bridge eth0 and tap0 for SIMH - can't ping default gateway or beyond?

Tue Jun 18, 2019 6:28 am

alanfleming wrote:
Mon Jun 17, 2019 9:53 pm
So br0 with an ip address, and nothing else with one. Routing table looks as you'd expect.
The routing table would be very interesting but you did not show the contents.
alanfleming wrote:
Mon Jun 17, 2019 9:53 pm
From the pi, I can ping both inside and outside the network. From an emulated machine attached to tap0, I can only ping devices on the local 192.168.1.0 network, not including the default gateway 192.168.1.1 or anything beyond it. When pinging, it looks as if packets don't end up on their correct interfaces - if I were pinging from the emulated machine, its (on tap0) TX packet numbers would go up, but RX packets would remain near 0.
If the pi functions as expected and the emulated machine does not then I suggest you look at the network parameters on the emulated machine because that is where the problem is most likely.
The road to insanity is paved with static ip addresses

alanfleming
Posts: 2
Joined: Thu Jun 13, 2019 9:26 pm

Re: Cannot bridge eth0 and tap0 for SIMH - can't ping default gateway or beyond?

Wed Jun 19, 2019 7:47 am

It wasn't the emulated machine. It was indeed the Pi.

Take-away here is on choosing an IP address for an emulated machine in SIMH, do not configure it in the Pi

Working config:

/etc/network/interfaces:

Code: Select all

auto eth0
iface eth0 inet manual

auto tap0
iface tap0 inet manual
  pre-up tunctl -t tap0 -u username
  up ifconfig tap0 up
  down ifconfig tap0 down

auto br0
iface br0 inet dhcp
  pre-up ifconfig tap0 up
  bridge_ports tap0 eth0
  bridge_stp off
  bridge_maxwait 5
and /etc/dhcpcd.conf:

Code: Select all

#denyinterfaces eth0

interface eth0
static ip_address=192.168.1.201/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
Though I'm pretty certain I can remove those sections from /etc/dhcpcd.conf and just leave it clean. I'll try that later.

Thank you for the help!

epoch1970
Posts: 3082
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Cannot bridge eth0 and tap0 for SIMH - can't ping default gateway or beyond?

Wed Jun 19, 2019 8:25 am

Bridge members do not have an IP config. You can remove the dhcpcd.conf entry for eth0 and reinstate denyinterfaces instead.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Advanced users”