1

I have slackware based server with openvpn bridging, this is my settings of interfaces:

root@senior:/# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.1  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::206:4fff:fe0d:4666  prefixlen 64  scopeid 0x20<link>
        ether 00:06:4f:0d:46:66  txqueuelen 0  (Ethernet)
        RX packets 16236  bytes 2359023 (2.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1369  bytes 1030491 (1006.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        inet6 fe80::206:4fff:fe0d:4666  prefixlen 64  scopeid 0x20<link>
        ether 00:06:4f:0d:46:66  txqueuelen 1000  (Ethernet)
        RX packets 18884  bytes 3383179 (3.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1516  bytes 1039564 (1015.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 11  base 0xc000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 115  bytes 7608 (7.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 115  bytes 7608 (7.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap0: flags=4355<UP,BROADCAST,PROMISC,MULTICAST>  mtu 1500
        inet6 fe80::2020:8ff:fee6:97b7  prefixlen 64  scopeid 0x20<link>
        ether 22:20:08:e6:97:b7  txqueuelen 100  (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 2 overruns 0  carrier 0  collisions 0

I'm using OpenVPN script to set up br0 and tap0 interfaces.

How to set up default gateway? This ip route add default via 192.168.1.254 doesn't work, it does set up default gateway, but via br0 and it doesn't work

root@senior:/home/kubi# ip route add default via 192.168.1.254
root@senior:/home/kubi# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.254   0.0.0.0         UG    0      0        0 br0
loopback        *               255.0.0.0       U     0      0        0 lo
localnet        *               255.255.255.0   U     0      0        0 br0
root@senior:/home/kubi# ping google.sk
PING google.sk (173.194.44.55) 56(84) bytes of data.
^C
--- google.sk ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

How to set up default gateway using eth0?

Buksy
  • 171
  • 2
  • 8
  • You can't use eth0 when it's attached to a bridge. br0 should be used instead. Your dns seems to work fine so you have a network connection working, maybe your gateway is blocking traffic. Try traceroute to see where it's blocked. – pupkinsen Apr 04 '13 at 05:56

2 Answers2

1

I found out that, there was no problem with my network.

The ping outside my local network does worked, but my firewall was blocking reply message so it looked like I cannot connect to internet. But if you take a look at ping, it was able to resolve the hostname, as the dns server is located outside my local network it is clear proof of that there is no problem with connecting to internet and default gateway.

I'm sorry for this stupid question, but I spend two days with this :).

Buksy
  • 171
  • 2
  • 8
0

Include the interface you want at the end of the route add command.

ip route add default via 192.168.1.254 eth0
Ryan
  • 912
  • 6
  • 12
  • 2
    `Error: either "to" is duplicate, or "eth0" is a garbage`. Is it even possible to work if eth0 has no ip set on? That openVPN script does remove ip address of eth0. – Buksy Apr 03 '13 at 21:35