Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 4 '13 at 5:56

2 Answers 2

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

ip route add default via 192.168.1.254 eth0
share|improve this answer
1  
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 3 '13 at 21:35

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 :).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.